MySQL 官方 GPG 密钥过期问题

Almalinux下安装mysql8:

dnf install -y https://dev.mysql.com/get/mysql80-community-release-el9-1.noarch.rpm

dnf install -y mysql-community-server

不幸收获报错:

MySQL 8.0 Community Server

GPG key at file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022 (0x3A79BD29) 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.46-1.el9.x86_64

GPG Keys are configured as: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022

Public key for mysql-community-client-plugins-8.0.46-1.el9.x86_64.rpm is not installed. Failing package is: mysql-community-client-plugins-8.0.46-1.el9.x86_64

GPG Keys are configured as: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022

Public key for mysql-community-common-8.0.46-1.el9.x86_64.rpm is not installed. Failing package is: mysql-community-common-8.0.46-1.el9.x86_64

GPG Keys are configured as: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022

Public key for mysql-community-icu-data-files-8.0.46-1.el9.x86_64.rpm is not installed. Failing package is: mysql-community-icu-data-files-8.0.46-1.el9.x86_64

GPG Keys are configured as: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022

Public key for mysql-community-libs-8.0.46-1.el9.x86_64.rpm is not installed. Failing package is: mysql-community-libs-8.0.46-1.el9.x86_64

GPG Keys are configured as: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022

Public key for mysql-community-server-8.0.46-1.el9.x86_64.rpm is not installed. Failing package is: mysql-community-server-8.0.46-1.el9.x86_64

GPG Keys are configured as: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022

The downloaded packages were saved in cache until the next successful transaction.

You can remove cached packages by executing 'dnf clean packages'.

Error: GPG check FAILED

之前安装都没错啊,怎么现在中奖了?

有人讲dnf install -y mysql-community-server --nogpgcheck 关闭校验就行了。然而这不是解决问题之道,绕开了坑,坑还在,迟早还得掉进行。

仔细看提示,都说了2022年的过期了,换2023年即可:

1. 导入 MySQL 最新的 GPG 密钥(2023版,解决校验失败)

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

2. 清理缓存

dnf clean all

3. 重新安装 MySQL

dnf install -y mysql-community-server

相关推荐
程序猿阿伟8 小时前
《一套完整方法论:搞定图形应用的Docker镜像优化》
数据库·docker·容器
二等饼干~za8986688 小时前
geo优化源码开发搭建技术分享
大数据·网络·数据库·人工智能·音视频
数据库小学妹9 小时前
HTAP混合负载架构:如何用一个数据库同时搞定交易和分析
数据库·经验分享·架构·dba
wuxinyan1239 小时前
工业级大模型学习之路029:解决双智能体调用数据库报错问题
数据库·人工智能·python·学习·智能体
Elastic 中国社区官方博客9 小时前
Elastic 线下 Meetup 将于 2026 年 7 月 26 号下午在深圳举行
大数据·数据库·人工智能·elasticsearch·搜索引擎·ai·全文检索
YL200404269 小时前
【Redis实战篇】秒杀实现方案(以优惠券秒杀为例)
数据库·redis
DIY源码阁9 小时前
JavaSwing宿舍管理系统 - MySQL版
java·数据库·mysql·eclipse
cfm_29149 小时前
MySQL8.0 InnoDB Cluster
数据库·mysql
kTR2hD1qb9 小时前
Claude Code Skill的介绍与使用
java·前端·数据库·人工智能