1、配置

[root@slaver4 ~]# wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm

报错没关系,看看下载好了就行

2、装它

 

[root@slaver4 package]# yum -y install mysql57-community-release-el7-10.noarch.rp

3、装数据库(花点时间,看网络)
yum -y install mysql-community-server


4、启动数据库
systemctl start mysqld

5、查找随机生成的密码
grep "password" /var/log/mysqld.log


6、修改root密码
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY '123456';