1.查看yum源
yum list |grep mysql
2.下载mysql的repo
wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
3.安装rpm
4.再执行yum list | grep mysql
5.安装
yum -y install mysql-server
6.启动
systemctl start mysqld.service
7.查看mysql是否启动
netstat -lntup|grep mysql
7.设置密码
mysql -uroot
use mysql
update user set password=password(‘xxxx‘) where user=‘root‘;
8.重启mysql服务器
systemctl restart mysqld.service
原文:https://www.cnblogs.com/LittleLee/p/12804460.html