1,下载mysql的repo源
wget https://repo.mysql.com//mysql57-community-release-el7-11.noarch.rpm
2,安装源
yum localinstall xx.rpm
3,安装mysql
yum install mysql-community-server
4,启动mysql
service mysqld start
5,查看状态
service mysqld status
6,查看默认密码
grep ‘temporary password‘ /var/log/mysqld.log
7,修改默认密码
ALTER USER ‘root‘@‘localhost‘ IDENTIFIED BY ‘MyNewPass4!‘;
原文:http://www.cnblogs.com/dongbo/p/7745579.html