Environment: Rocky 9.1
,MySQL 8.0 / MySQL 5.7
Table of contents
1. Problem analysis
# 报错日志如下:
Downloading Packages:
[SKIPPED] mysql-community-client-8.0.32-1.el8.x86_64.rpm: Already downloaded
[SKIPPED] mysql-community-client-plugins-8.0.32-1.el8.x86_64.rpm: Already downloaded
[SKIPPED] mysql-community-common-8.0.32-1.el8.x86_64.rpm: Already downloaded
[SKIPPED] mysql-community-icu-data-files-8.0.32-1.el8.x86_64.rpm: Already downloaded
[SKIPPED] mysql-community-libs-8.0.32-1.el8.x86_64.rpm: Already downloaded
[SKIPPED] mysql-community-server-8.0.32-1.el8.x86_64.rpm: Already downloaded
[SKIPPED] compat-openssl11-1.1.1k-4.el9_0.x86_64.rpm: Already downloaded
MySQL 8.0 Community Server 27 MB/s | 27 kB 00:00
GPG key at file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql (0x5072E1F5) is already installed
The GPG keys listed for the "MySQL 8.0 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-8.0.32-1.el8.x86_64
GPG Keys are configured as: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
Public key for mysql-community-client-plugins-8.0.32-1.el8.x86_64.rpm is not installed. Failing package is: mysql-community-client-plugins-8.0.32-1.el8.x86_64
GPG Keys are configured as: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
Public key for mysql-community-common-8.0.32-1.el8.x86_64.rpm is not installed. Failing package is: mysql-community-common-8.0.32-1.el8.x86_64
GPG Keys are configured as: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
Public key for mysql-community-icu-data-files-8.0.32-1.el8.x86_64.rpm is not installed. Failing package is: mysql-community-icu-data-files-8.0.32-1.el8.x86_64
GPG Keys are configured as: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
Public key for mysql-community-libs-8.0.32-1.el8.x86_64.rpm is not installed. Failing package is: mysql-community-libs-8.0.32-1.el8.x86_64
GPG Keys are configured as: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
Public key for mysql-community-server-8.0.32-1.el8.x86_64.rpm is not installed. Failing package is: mysql-community-server-8.0.32-1.el8.x86_64
GPG Keys are configured as: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
The downloaded packages were saved in cache until the next successful transaction.
You can remove cached packages by executing 'yum clean packages'.
Error: GPG check FAILED
"" The error log has actually described the error message very clearly. To put it bluntly, it means that the verification GPG
failed :
文件中的 GPG 密钥:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql (0x5072E1F5) 已安装
为“MySQL 8.0 Community Server”存储库列出的 GPG 密钥已经安装,但它们对于此包不正确。
检查是否为此存储库配置了正确的密钥 URL。失败的包是:mysql-community-client-8.0.32-1.el8.x86_64
2. Solutions
2.1 Import new GPG key directly (recommended)
MySQL
The latest GPG
key
is placed in its official warehouse address: https://repo.mysql.com
From the update date, it can be seen that it has been replaced once MySQL
2022
in year , and as of 2023年3月17
date, the latest one is still updated 2022
in year . If you encounter this kind of error again in the future, you can go to the official warehouse address to have a look, and use the latest one if you have the latest one.
# 如果出现上面的报错,需要导入最新的 GPG key
rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022
After the import is executed successfully, you can continue to execute the corresponding installation command:
yum install mysql-community-server
2.2 Skip verification (not recommended)
yum install mysql-community-server -y --nogpgcheck
Parameter description:
-y
: The operation to be confirmed in the installation does not need to ask, the default yes
.
--nogpgcheck
: ignore gpg
validation .
3. Other
MySQL
This is still easy to find, Docker Hub
sometimes it will directly upgrade the mirror image ( image
), it’s all tears.
Trample record: the project has been Docker Hub
using tomcat:8
the image on , which is used in the image JDK 1.8
; but once when the latest was obtained, the project could not be started directly. After half a day of investigation, the result was that the inside of the image JDK
changed 11
, and it took almost 2 years No one thought it would be upgraded, haha. Later, the basic image was encapsulated for the second time, and then uploaded to a private warehouse; although the official image is good, don’t be greedy, but it’s best to customize it yourself.
Personal blog: Roc's Blog