安装mysql-community-server时出现以下错误:
命令:
sudo yum install mysql-community-server
错误:
warning: /var/cache/yum/x86_64/2/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
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-libs-compat-5.7.37-1.el7.x86_64
GPG Keys are configured as: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
任何人都可以帮忙吗...
来自:https://dev.mysql.com/doc/refman/8.0/en/checking-rpm-signature.html
没有单独的签名。 RPM 包有内置的 GPG 签名和 MD5 校验和。
rpm 还支持直接从 URL 加载密钥:
rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2023
新版本的 GPG 密钥已更改。请参阅此以获取更多信息: https://support.cpanel.net/hc/en-us/articles/4419382481815?input_string=gpg+keys+problem+with+mysql+5.7
解决此错误的步骤需要安装更新的 MySQL GPG。
对于现有系统,/etc/yum.repos.d/ 中的 MySQL 存储库文件需要将其“gpgkey”行调整为:
gpgkey=https://repo.mysql.com/RPM-GPG-KEY-mysql-2022
调整后,再次运行更新:
/usr/local/cpanel/scripts/upcp
对于新安装,您可以在运行安装程序之前导入密钥:
Ubuntu:
wget -q -O https://repo.mysql.com/RPM-GPG-KEY-mysql-2022 | apt-key add -
我在两个仅 DNS 服务器上遇到了同样的问题。
我编辑了 /etd/yum.repos.d/Mysql57.repo 文件并将所有“gpgcheck=1”行更改为“gpgcheck=0”
然后我执行了 yum update
然后我编辑了 /etd/yum.repos.d/Mysql57.repo 文件并将所有“gpgcheck=0”行更改回“gpgcheck=1”
最后我更新了cPanel软件。
您可以使用以下其中一项。
基于 rpm 的安装:
rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022
基于Apt:
wget -q -O - https://repo.mysql.com/RPM-GPG-KEY-mysql-2022 | apt-key add -
这在 Debian 11 上为我解决了这个问题:
wget --quiet --output-document - https://repo.mysql.com/RPM-GPG-KEY-mysql-2022 | gpg --no-default-keyring --keyring gnupg-ring:/etc/apt/trusted.gpg.d/mysql2022.gpg --import
chmod 644 /etc/apt/trusted.gpg.d/mysql2022.gpg
之前
apt-get update
报了按键错误,之后就一切正常了。