一:检查CentOS是否有系统自带的mysql
yum list installed | grep mysql
二:下载rpm包,并安装本地mysql源
下载rpm包: wget https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm --no-check-certificate
安装mysql源: yum localinstall mysql80-community-release-el7-3.noarch.rpm
三:验证是否安装成功
yum repolist all | grep mysql
如下图,默认的MySQL版本为8.0
四:修改默认安装版本为5.7
vim /e