检查系统是否已有自带mysql
# 检查
rpm -qa | grep mysql
# 如果有,则删除
rpm -e --nodeps xxx已安装的程序
# 检查并卸载
yum list installed | grep mariadb
# 卸载
yum -y remove mariadb-libs.x86_64
官网下载安装包
# wget方式下载
wget https://dev.mysql.com/get/mysql57-community-release-el7-9.noarch.rpm
mysql安装包官网:https://dev.mysql.com/downloads/mysql/
# 准备的安装包
mysql57-community-release-el7-9.noarch.rpm
mysql-community-common-5.7.18-1.el7.x86_64.rpm
mysql-community-libs-5.7.18-1.el7.x86_64.rpm
mysql-community-client-5.7.18-1.el7.x86_64.rpm
mysql-community-server-5.7.18-1.el7.x86_64.rpm
mysql-community-devel-5.7.18-1.el7.x86_64.rpm
# 按顺序依次安装以上准备的rpm安装包
rpm -ivh mysql57-community-release-el7-9.noarch.rpm
rpm -ivh mysql-community-common-5.7.18-1.el7.x86_64.rpm
rpm -ivh mysql-community-libs-5.7.18-1.el7.x86_64.rpm
rpm -ivh mysql-community-client-5.7.18-1.el7.x86_64.rpm
rpm -ivh mysql-community-server-5.7.18-1.el7.x86_64.rpm
rpm -ivh mysql-community-devel-5.7.18-1.el