CentOS 8 服务器安装 MySQL 报错:no match mysql-community-server

参考 MySQL 官方文档:

报错如下:

1.No match for argument: mysql-community-server
2.Error: Unable to find a match: mysql-community-server

上面的错误都提示找不到 mysql-community-server

【注】出现问题的核心原因为:基于RHEL 8Oracle Linux 8的基于EL8的系统,在默认情况下附带了一个名为mysqlyum模块。 除非禁用此模块,否则它将屏蔽MySQL存储库提供的软件包。只要是 EL8 系统安装任何版本的 MySQL 都会有这样的问题。

官方原话:
(EL8 systems only) EL8-based systems such as RHEL8 and Oracle Linux 8 include a MySQL module that is enabled by default. Unless this module is disabled, it masks packages provided by MySQL repositories. To disable the included module and make the MySQL repository packages visible, use the following command (for dnf-enabled systems, replace yum in the command with dnf)。

禁用方法如下:

yum module disable mysql

# 如果是 dnf,命令如下:
dnf module disable mysql

然后继续安装 MySQL Server

sudo yum install mysql-community-server

接下来就可以愉快的安装 MySQL 8.0 了。

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注