Centos7 安装MySQl8.0报错:“MySQL 8.0 Community Server“ 的 GPG 密钥已安装,但是不适用于此软件包

报错具体内如如下:

bash 复制代码
从 file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022 检索密钥
从 file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql 检索密钥


源 "MySQL 8.0 Community Server" 的 GPG 密钥已安装,但是不适用于此软件包。请检查源的公钥 URL 是否配置正确。


 失败的软件包是:mysql-community-client-plugins-8.0.40-1.el7.x86_64
 GPG  密钥配置为:file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022, file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

1、检查GPG密钥URL配置是否正确:

bash 复制代码
vim /etc/yum.repos.d/mysql-community-repo

我的配置如下,是正确的:

bash 复制代码
[mysql80-community]
name=MySQL 8.0 Community Server
baseurl=https://mirrors.tuna.tsinghua.edu.cn/mysql/yum/mysql-8.0-community-el7-$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022
      file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

2、尝试重新导入GPG密钥:

bash 复制代码
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

重新导入GPG密钥后再次安装软件:

bash 复制代码
yum install -y mysql-community-server

3、GPG密钥重置后大部分可以解决,如果仍然安装失败,可以使用 --nogpgcheck 选项来禁用GPG密钥检查。这样可以确保安装成功,但安全性会降低,需要选择可靠的源来下载软件包:

bash 复制代码
yum install --nogpgcheck mysql-community-server
相关推荐
_Johnny_10 小时前
ETCD 配额/空间告警模拟方案
网络·数据库·etcd
猫头虎10 小时前
基于信创openEuler系统安装部署OpenTeleDB开源数据库的实战教程
数据库·redis·sql·mysql·开源·nosql·database
爬山算法11 小时前
MongoDB(1)什么是MongoDB?
数据库·mongodb
Nandeska11 小时前
17、MySQL InnoDB ReplicaSet
数据库·mysql
AI_567811 小时前
SQL性能优化全景指南:从量子执行计划到自适应索引的终极实践
数据库·人工智能·学习·adb
hlABgYML11 小时前
基于NGSIM数据的Wiedemann99跟驰模型标定
mysql
数据知道11 小时前
PostgreSQL 性能优化:分区表实战
数据库·postgresql·性能优化
静听山水11 小时前
StarRocks表模型详解
数据库
静听山水12 小时前
Redis核心数据结构-Set
数据结构·数据库·redis
墨理学AI12 小时前
一文学会一点python数据分析-小白原地进阶(mysql 安装 - mysql - python 数据分析 - 学习阶段梳理)
python·mysql·数据分析