1. 下载rpm包
wget https://dev.mysql.com/get/mysql57-community-release-el6-9.noarch.rpm
2.安装rpm包
rpm -Uvh mysql57-community-release-el6-9.noarch.rpm
或
yum localinstall -y mysql57-community-release-el6-9.noarch.rpm
3. 安装mysql
yum install mysql-community-server
4.开启服务
service mysqld start
查找密码
grep 'temporary password' /var/log/mysqld.log
登入
mysql -uroot -p
修改密码
alter user 'root'@'localhost' identified by '123456';