1,安装wget
yum -y install wget
#准备工作
yum install lrzsz
2,下载源
wget https://dev.mysql.com/get/mysql80-community-release-el7-1.noarch.rpm
#如果上面不通就使用下面这个
wget https://dev.mysql.com/get/mysql80-community-release-el7-5.noarch.rpm
3,下载MySQL源
yum install mysql mysql-server
yum -y localinstall mysql80-community-release-el7-11.noarch.rpm
#下载MySQL源跟上面源对应
yum -y localinstall mysql80-community-release-el7-5.noarch.rpm
4,在线安装MySQL
yum -y install mysql-community-server
5,无密码登录MySQL(另一篇文章中):MySQL8.0无密码登录_爱笑的rabbit的博客-CSDN博客
6,如出现如下错误:
这是提示我们 GPG密钥和yum源包里面的下载链接的URL不匹配,请先使用下面命令,后重新执行MySQL安装命令
rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022
yum -y install mysql-community-server