tar -xvf mysql-5.7.17-linux-glibc2.5-x86_64.tar.gz
mkdir -p /usr/local/mysql/data mv mysql-5.7.17-linux-glibc2.5-x86_64/* /usr/local/mysql/
groupadd mysql
useradd -g mysql -d /usr/local/mysql mysql
chown -R mysql.mysql /usr/local/mysql/
./bin/mysqld --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --initialize
root@localhost: >HLaOQH;U6L3
cp -a ./support-files/my-default.cnf /etc/my.cnf #会有一个选择是否覆盖原有文件,直接按 y回车选择是就可以
# These are commonly set, remove the # and set as required. basedir = /usr/local/mysql datadir = /usr/localmysql/data port = 3306 # server_id = ..... socket = /tmp/mysql.sock character-set-server=utf-8
mysql/support-files/mysql.server restart
cp -a ./support-files/mysql.server /etc/init.d/mysqld
# cp /home/mysql/support-files/mysql.server /etc/init.d/mysqld # 拷贝启动文件到/etc/init.d/下并重命令为mysqld # chmod 755 /etc/init.d/mysqld # 增加执行权限 # chkconfig --list mysqld # 检查自启动项列表中没有mysqld这个, # chkconfig --add mysqld # 如果没有就添加mysqld: # chkconfig mysqld on # 用这个命令设置开机启动:
# ln -s /home/mysql/bin/mysql /usr/bin/mysql
# service mysqld start # 启动服务 # service mysqld restart # 重启服务 # service mysqld stop # 停止服务
./bin/mysqladmin -u root -p 或者 mysql -u root -p
>HLaOQH;U6L3
mysql> SET PASSWORD = PASSWORD('123456');
find / -name mysql.sock
show variables like 'character%'; # 查询编码 SET character_set_database = utf8; ----设置编码
1)mysql> grant all privileges on *.* to 'root'@'%' identified by '123456'; 2)grant all on *.* to 'root'@'%' identified by '123456';
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有