centos 7 & mysql 5.7 gpg key error proper solution

If you’re running CentOS7 and using the MySQL 5.7 community rpm package you might’ve ran into this error response:

Seems like Oracle has changed their GPG key and it’s not uploaded to gpg servers yet, at least yum can’t find the new key.
So you have to manually replace your key.

Disabling gpgcheck is a very bad idea and should never be done, despite what some chinese blogger suggests for a solution. (https://www.cnblogs.com/minseo/p/15835416.html)
The proper solution is to take the key from the mysql5.7 gpg signature checking documentation page and replace the current contents of /etc/pki/rpm-gpg/RPM-GPG-KEY-mysql with this key.

I will replicate the key here, but be sure to check mysql5.7 gpg signature checking documentation page for the current signature.

DO NOT DISABLE gpgcheck as suggested in the chinese blog.

3 Replies to “centos 7 & mysql 5.7 gpg key error proper solution”

  1. This is still an issue even today…as you say disabling the GPG check is not a solution. Thanks, without this I’d have struggled to find the cause of the issue.

  2. Can I simply edit existing /etc/pki/rpm-gpg/RPM-GPG-KEY-mysql file and paste into content of new RPM-GPG-KEY-mysql-2022 key?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.