前言
我们通过Yum几乎全自动的快速安装MySQL服务,这里演示的是8.0版本
更换国内yum源提速
参考 CentOS更换YUM源更换yum源,国内下载速度更快
echo "安装MySQL Yum Repository仓库" > /dev/null yum -y localinstall https://dev.mysql.com/get/mysql80-community-release-el7-1.noarch.rpm echo "安装MySQL,这一步需要时间较长" > /dev/null yum -y install mysql-community-server
安装mysql报如下异常
Public key for mysql-community-icu-data-files-8.0.29-1.el7.x86_64.rpm is not installed Failing package is: mysql-community-icu-data-files-8.0.29-1.el7.x86_64 GPG Keys are configured as: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
原因是Mysql的GPG升级了,需要重新获取
使用以下命令即可rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022
再执行yum -y install mysql-community-server



