使用yum源安装多个版本的MySQL数据库

 每次想用yum安装旧版本的mysql时,发现都找不到mysql的yum安装源,在官网只能找到最新版本mysql的yum源。后来才知道,原来最新的mysql的yum源也是包含了旧版本的mysql的yum源,只需要开启改安装源即可。

系统版本:Centos7.7

MySQL版本:5.7

安装方法:使用官方Yum源安装

MySQL配置文件:/etc/my.cnf

具体步骤如下:

wget https://repo.mysql.com//mysql80-community-release-el7-3.noarch.rpm
rpm -Uvh mysql80-community-release-el7-3.noarch.rpm
sed -i '21c enabled=1' /etc/yum.repos.d/mysql-community.repo
sed -i '28c enabled=0' /etc/yum.repos.d/mysql-community.repo
yum clean all
yum install mysql-server mysql -y
systemctl start mysqld
cat /var/log/mysqld.log |grep pass

wget https://repo.mysql.com//mysql80-community-release-el7-3.noarch.rpm
rpm -Uvh mysql80-community-release-el7-3.noarch.rpm
sed -i '21c enabled=1' /etc/yum.repos.d/mysql-community.repo
sed -i '28c enabled=0' /etc/yum.repos.d/mysql-community.repo
yum clean all
yum install  mysql-server mysql -y
systemctl start mysqld
cat /var/log/mysqld.log |grep pass

原文地址:https://www.cnblogs.com/biaopei/p/11213563.html