1.将MySQL安装包拉至/opt/software/文件夹中
2.检查系统中是否安装过MySQL
rpm -qa|grep mariadb
mariadb-libs-5.5.56-2.el7.x86_64 //如果存在通过如下命令卸载
3. rpm -e --nodeps mariadb-libs 用此命令卸载mariadb
4.将MySQL解压到/opt/module/文件夹下
cd /opt/software/
tar -zxvf 压缩包名 -C /opt/module/
5.安装对应的RPM文件
获取插件,命令如下:
yum install -y libaio
依次执行命令:
sudo rpm -ivh --nodeps mysql-community-common-5.7.36-1.el7.x86_64.rpm
sudo rpm -ivh --nodeps mysql-community-libs-5.7.36-1.el7.x86_64.rpm
sudo rpm -ivh --nodeps mysql-community-libs-compat-5.7.36-1.el7.x86_64.rpm
sudo rpm -ivh --nodeps mysql-community-client-5.7.36-1.el7.x86_64.rpm
sudo rpm -ivh --nodeps mysql-community-server-5.7.36-1.el7.x86_64.rpm
切换到etc文件夹
cd /etc