卸载系统自带的mariadb
[root@10 ~]# yum remove mariadb-libs.x86_64
下载MySQL5.7的源
[root@10 ~]# wget https://repo.mysql.com/mysql57-community-release-el7-8.noarch.rpm
安装MySQL5.7的源
[root@10 ~]# yum localinstall mysql57-community-release-el7-8.noarch.rpm
下载MySQL服务
[root@10 ~]# yum install mysql-community-server -y
启动MySQL
[root@10 ~]# service mysqld start
查看初始密码:
[root@10 ~]# cat /var/log/mysqld.log | grep 'password'
20