1. wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
2. rpm -ivh mysql-community-release-el7-5.noarch.rpm
3.sudo yum install mysql-server
4.service mysqld restart
mysql -u root
5.use mysql;
update user set password=password('new password') where user='root';
flush privileges;
引自https://www.cnblogs.com/huangxinyuan650/p/6360464.html