【mysql】解决MySQL GPG密钥过期问题

MySQL GPG 密钥过期,yum下载mysql-devel报错

正文开始@Assassin

目录:

  • MySQL GPG 密钥过期,yum下载mysql-devel报错
    • 症状:
    • 描述:
    • 解决方法:

记录make中的一次报错~~

刚刚centos7在执行make时遇到以下报错:
【mysql】解决MySQL GPG密钥过期问题_第1张图片

fatal error: mysql/mysql.h: No such file or directory
#include
compilation terminated.

原因是找不到mysql.h头文件,于是使用以下命令安装对应的包:

sudo yum install mysql-devel

但是却出现了如下的报错:
只能说翻来覆去找了很久都没找到有用的方法,还是得StackOverflow
【mysql】解决MySQL GPG密钥过期问题_第2张图片

Downloading packages:
warning: /var/cache/yum/x86_64/7/mysql57-community/packages/mysql-community-devel-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-devel-5.7.37-1.el7.x86_64
GPG Keys are configured as: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
 
==翻译:==
 
警告:/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

为“MySQL 5.7 社区服务器”存储库列出的 GPG 密钥已经安装,但它们对于这个包不正确。
检查是否为此存储库配置了正确的密钥 URL。

失败的包是:mysql-community-libs-compat-5.7.37-1.el7.x86_64
GPG 密钥配置为:file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

症状:

官方 MySQL 存储库的 GPG 密钥已过期,无法安装或更新 MySQL 包。
为 “MySQL 5.7 社区服务器” 存储库列出的 GPG 密钥已经安装,但它们对于这个包不正确

错误类似于:

为“MySQL 8.0 社区服务器”存储库列出的 GPG 密钥已安装,但对于此包来说它们不正确。检查是否为此存储库配置了正确的密钥 URL。失败的包是:mysql-community-client-8.0.28-1.el8.x86_64 GPG 密钥配置为:http://repo.mysql.com/RPM- GPG-KEY-mysql
未安装 mysql-community-client-plugins-8.0.28-1.el8.x86_64.rpm 的公钥。失败的包是:mysql-community-client-plugins-8.0.28-1.el8.x86_64 GPG 密钥配置为:http://repo.mysql.com/RPM-GPG-KEY-mysql 
mysql-community 的公钥-common-8.0.28-1.el8.x86_64.rpm 未安装。失败的包是:mysql-community-common-8.0.28-1.el8.x86_64 GPG 密钥配置为:http://repo.mysql.com/RPM-GPG-KEY-mysql
未安装 mysql-community-devel-8.0.28-1.el8.x86_64.rpm 的公钥。失败的包是:mysql-community-devel-8.0.28-1.el8.x86_64 GPG 密钥配置为:http://repo.mysql.com/RPM-GPG-KEY-mysql 
mysql-community-icu 的公钥-data-files-8.0.28-1.el8.x86_64.rpm 未安装。失败的包是:mysql-community-icu-data-files-8.0.28-1.el8.x86_64 GPG 密钥配置为:http://repo.mysql.com/RPM-GPG-KEY-mysql 
mysql 的公钥-community-libs-8.0.28-1.el8.x86_64.rpm 未安装。失败的包是:mysql-community-libs-8.0.28-1.el8.x86_64 GPG 密钥配置为:http://repo.mysql.com/RPM-GPG-KEY-mysql
未安装 mysql-community-server-8.0.28-1.el8.x86_64.rpm 的公钥。失败的包是:mysql-community-server-8.0.28-1.el8.x86_64 GPG 密钥配置为:http://repo.mysql.com/RPM-GPG-KEY-mysql 错误:GPG 检查失败

描述:

MySQL GPG 密钥已过期。有关案例的其他详细信息也可以在 MySQL 网站上找到: https /bugs.mysql.com/bug.php?id=106188

解决方法:

Note
If you are using RPM 4.1 and it complains about (GPG) NOT OK (MISSING KEYS: GPG#3a79bd29), even though you have imported the MySQL public build key into your own GPG keyring, you need to import the key into the RPM keyring first. RPM 4.1 no longer uses your personal GPG keyring (or GPG itself). Rather, RPM maintains a separate keyring because it is a system-wide application and a user’s GPG public keyring is a user-specific file. To import the MySQL public key into the RPM keyring, first obtain the key, then use rpm --import to import the key. For example:

可以在运行安装程序之前导入密钥:

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

Ubuntu:

wget -q -O - https://repo.mysql.com/RPM-GPG-KEY-mysql-2022 | apt-key add -

之后再执行yum install mysql-devel 就over了
【mysql】解决MySQL GPG密钥过期问题_第3张图片
makefile:
【mysql】解决MySQL GPG密钥过期问题_第4张图片
在这里插入图片描述

你可能感兴趣的:(实用经验,mysql,linux,数据库)