centos7安装mysql遇到的错误

更新密钥

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

解决方法:

  1. 更新gpg秘钥。rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2023
  2. /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
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容