Centos7默认自带的数据库为Mariadb,需要先卸载
rpm -qa | grep mariadb
rpm -e --nodeps mariadb-5.5.68-1.el7.x86_64
rpm -e --nodeps mariadb-libs-5.5.68-1.el7.x86_64
卸载完成之后,需要设置Mysql的yum源:
右键Download复制链接,使用wget下载到本地
[root@cvm-3i693bp28a225 Download]# wget https://repo.mysql.com//mysql80-community-release-el7-3.noarch.rpm
[root@cvm-3i693bp28a225 Download]# ls
mysql80-community-release-el7-3.noarch.rpm
[root@cvm-3i693bp28a225 Download]# yum install mysql80-community-release-el7-3.noarch.rpm
进入配置文件,可选择指定版本的Mysql,Enable = 1(默认为最新版本)
随后使用yum安装
yum -y install mysql-community-server
稍等片刻就会安装完毕