问题描述
centos7安装mysql5.7时遇到一个诡异的问题
sudo yum localinstall https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm
sudo yum install mysql-community-server
然后遇到了下面的问题Public key for mysql-community-libs-compat-xxx.rpm is not installed
具体输出如下
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
(1/9): libaio-0.3.109-13.el7.x86_64.rpm | 24 kB 00:00:00
warning: /var/cache/yum/x86_64/7/mysql57-community/packages/mysql-community-common-5.7.37-1.el7.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID 3a79bd29: NOKEY
Public key for mysql-community-common-5.7.37-1.el7.x86_64.rpm is not installed
(2/9): mysql-community-common-5.7.37-1.el7.x86_64.rpm | 311 kB 00:00:00
(3/9): mysql-community-libs-5.7.37-1.el7.x86_64.rpm | 2.4 MB 00:00:00
(4/9): mysql-community-libs-compat-5.7.37-1.el7.x86_64.rpm | 1.2 MB 00:00:00
(5/9): openssl-1.0.2k-24.el7_9.x86_64.rpm | 494 kB 00:00:00
(6/9): openssl-libs-1.0.2k-24.el7_9.x86_64.rpm | 1.2 MB 00:00:00
(7/9): postfix-2.10.1-9.el7.x86_64.rpm | 2.4 MB 00:00:00
(8/9): mysql-community-client-5.7.37-1.el7.x86_64.rpm | 25 MB 00:00:01
(9/9): mysql-community-server-5.7.37-1.el7.x86_64.rpm | 174 MB 00:00:16
---------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 12 MB/s | 207 MB 00:00:16
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
Importing GPG key 0x5072E1F5:
Userid : "MySQL Release Engineering <mysql-build@oss.oracle.com>"
Fingerprint: a4a9 4068 76fc bd3c 4567 70c8 8c71 8d3b 5072 e1f5
Package : mysql57-community-release-el7-11.noarch (installed)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
Is this ok [y/N]: y
Public key for mysql-community-libs-compat-5.7.37-1.el7.x86_64.rpm is not installed
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
解决方式:
rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022
成功就点个赞吧,谢谢。
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。