#########查看系统版本###########
[root@ ~]# cat /etc/redhat-release
CentOS Linux release 7.9.2009 (Core)
-
centOS7中默认安装了MariaDB,需要先进行卸载
rpm -qa | grep -i mariadb
rpm -e --nodeps mariadb-libs-5.5.64-1.el7.x86_64
查询下本机mysql是否卸载干净
rpm -qa | grep mysql
-
下载MySQL仓库并安装
wget https://repo.mysql.com//mysql80-community-release-el7-3.noarch.rpm
等待完成
yum -y install mysql80-community-release-el7-3.noarch.rpm
-
安装MySQL数据库
yum -y install mysql-community-server
如果报错(坑!!!!!!!!)
The GPG keys listed for the "MySQL 8.0 Community Server" repository are already installed but they are not correct for this package.
Check that the correct key URLs are configured for this repository.
Failing package is: mys