一直都是直接用docker来部署mysql, 最近想研究研究myql的配置文件和主从架构,就像直接在物理机中安装mysql。安装的过程中就出现了GPGkey错误。

具体的报错如下所示:

Downloading packages:
warning: /var/cache/yum/x86_64/7/mysql57-community/packages/mysql-community-libs-compat-5.7.37-1.el7.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID 3a79bd29: NOKEY
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql


The GPG keys listed for the "MySQL 5.7 Community Server" repository are already installed but they are not correct for this package.
Check that the correct key URLs are configured for this repository.


 Failing package is: mysql-community-libs-compat-5.7.37-1.el7.x86_64
 GPG Keys are configured as: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

尝试删除/etc/pki/rpm-gpg/RPM-GPG-KEY-mysql 文件然后从官网重下下载一个发现还是无法解决。

最后搜索发现有相同的问题:https://support.cpanel.net/hc/en-us/articles/4419382481815?input_string=gpg+keys+problem+with+mysql+5.7icon-default.png?t=M0H8https://support.cpanel.net/hc/en-us/articles/4419382481815?input_string=gpg+keys+problem+with+mysql+5.7

文章的大致意思就是:官方 MySQL 存储库的 GPG 密钥已过期,无法安装或更新 MySQL 包。 

mysql官网也提交了该bug:MySQL Bugs: #106188: The MySQL GPG key seems to be incorrecthttps://bugs.mysql.com/bug.php?id=106188

新装mysql可以使用的解决方案就是重新导入新的秘钥:

rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022

亲测该方案有效。

Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐