更新密钥
rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2023
安装Mysql8.x版本 yum库
rpm -Uvh https://dev.mysql.com/get/mysql80-community-release-el7-2.noarch.rpm
yum安装Mysql
yum -y install mysql-community-server
启动mysql
systemctl start mysqld
开机自启mysqld
systemctl enable mysqld
检查mysqld运行状态
systemctl status mysqld
遇到错误1:
Failed to start mysqld.service: Unit not found.
解决方法:yum -y install mariadb mariadb-devel mariadb-server
遇到错误2:
Failing package is: mysql-community-libs-8.0.37-1.el7.x86_64,GPG Keys are configured as: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
解决方法:
- 更新gpg秘钥。
rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2023
- 在
/etc/yum.repos.d
路径下找到mysql-community.repo
文件,将gpgcheck=1
全部改成gpgcheck=0
遇到错误3
No package mysql-server available.
解决方法:
更新mysql的rpm源
wget https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm
rpm -Uvh mysql80-community-release-el7-3.noarch.rpm
网友评论