yum update -y报错:The GPG keys listed for the MySQL 5.7 Community Server repository are already installed but they are not correct for this package.

yum update -y升级系统时遭遇下面的错误

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
~]# yum update -y
...
warning: /var/cache/yum/x86_64/7/mysql57-community/packages/mysql-community-common-5.7.44-1.el7.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID 3a79bd29: NOKEY
Public key for mysql-community-common-5.7.44-1.el7.x86_64.rpm is not installed
...

Total 12 MB/s | 550 MB 00:00:45
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-client-5.7.44-1.el7.x86_64
GPG Keys are configured as: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

MySQL8以后包签名所用的Key发生了变化,用以下命令导入新的Key即可解决问题。

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