安装1
2
3
4yum -y install https://repo.mysql.com/mysql57-community-release-el6-11.noarch.rpm
yum update -y
yum -y install mysql-community-server
service mysqld start
查看密码1
2
3grep 'temporary password' /var/log/mysqld.log
# 显示如下
2017-12-20T15:32:24.436697Z 1 [Note] A temporary password is generated for root@localhost: th.otyKdt0f.
1 | mysql -uroot -p |
密码就是:1
2
**修改密码**
ALTER USER ‘root‘@’localhost’ IDENTIFIED BY ‘MyNewPass4!’;1
2
**修改远程登录**
use mysql;
GRANT ALL PRIVILEGES ON . TO ‘root‘@’%’ IDENTIFIED BY ‘password’ WITH GRANT OPTION;
FLUSH PRIVILEGES;
quit();
service mysqld restart
service iptables stop`