在centos7中安装mysql时出现的问题

在centos7中安装mysql时出现的问题: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.


Check that the correct key URLs are configured for this repository.

Failing package is: mysql-community-libs-8.0.39-1.el7.x86_64
GPG Keys are configured as: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql)

1. 出现错误的操作步骤

1.添加 MySQL Yum Repository MySQL 社区版默认没有包含在 CentOS 的标准包中,所以需要先添加 MySQL 的官方仓库:

sudo yum install https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm

出现command not found字样,是你的虚拟机没安装yum,自己去安装一下,就一个命令
2.安装 MySQL 添加仓库后,可以使用 yum 安装 MySQL:

sudo yum install mysql-server

这个时候出现了错误:

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-libs-8.0.39-1.el7.x86_64
 GPG Keys are configured as: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

意思就是说MySQL 8.0 Community Server,这个8.0与GPG Keys不匹配
那就好办,直接换一个版本不就好了

2 解决办法

输入命令

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

这篇文章时2024年写的,我感觉规律就是晚一年的这个版本就好了
再把上面的命令执行一遍就好了

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值