centos 7 安装mysql 5.7失败 出现 Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
Public key for mysql-community-common-5.7.40-1.el7.x86_64.rpm is not installed (1/5): mysql-community-common-5.7.40-1.el7.x86_64.rpm | 311 kB 00:01 (2/5): mysql-community-libs-5.7.40-1.el7.x86_64.rpm | 2.6 MB 00:02 (3/5): mysql-community-libs-compat-5.7.40-1.el7.x86_64.rpm | 1.2 MB 00:01 (4/5): mysql-community-client-5.7.40-1.el7.x86_64.rpm | 28 MB 00:17 (5/5): mysql-community-server-5.7.40-1.el7.x86_64.rpm | 178 MB 01:02 -------------------------------------------------------------------------------- Total 3.1 MB/s | 211 MB 01:07 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-10.noarch (@/mysql57-community-release-el7-10.noarch) From : /etc/pki/rpm-gpg/RPM-GPG-KEY-mysql Public key for mysql-community-client-5.7.40-1.el7.x86_64.rpm is not installed
解决办法:
[wxm@localhost ~]$ sudo vi /etc/yum.repos.d/ CentOS-Base.repo CentOS-Sources.repo CentOS-Base.repo.backup CentOS-Vault.repo CentOS-CR.repo CentOS-x86_64-kernel.repo CentOS-Debuginfo.repo mysql-community.repo CentOS-fasttrack.repo mysql-community-source.repo CentOS-Media.repo vscode.repo [wxm@localhost ~]$ sudo vi /etc/yum.repos.d/mysql-community.repo
修改密钥文件:
对应行替换为以下内容
gpgkey=https://repo.mysql.com/RPM-GPG-KEY-mysql-2022
或者在安装前指定密钥:
rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022
修改完后重新安装:
Importing GPG key 0x3A79BD29: Userid : "MySQL Release Engineering <mysql-build@oss.oracle.com>" Fingerprint: 859b e8d7 c586 f538 430b 19c2 467b 942d 3a79 bd29 From : https://repo.mysql.com/RPM-GPG-KEY-mysql-2022 Running transaction check Running transaction test Transaction test succeeded Running transaction Installing : mysql-community-common-5.7.40-1.el7.x86_64 1/6 Installing : mysql-community-libs-5.7.40-1.el7.x86_64 2/6 Installing : mysql-community-client-5.7.40-1.el7.x86_64 3/6 Installing : mysql-community-server-5.7.40-1.el7.x86_64 4/6 Installing : mysql-community-libs-compat-5.7.40-1.el7.x86_64 5/6 Erasing : 1:mariadb-libs-5.5.68-1.el7.x86_64 6/6 Verifying : mysql-community-client-5.7.40-1.el7.x86_64 1/6 Verifying : mysql-community-server-5.7.40-1.el7.x86_64 2/6 Verifying : mysql-community-common-5.7.40-1.el7.x86_64 3/6 Verifying : mysql-community-libs-5.7.40-1.el7.x86_64 4/6 Verifying : mysql-community-libs-compat-5.7.40-1.el7.x86_64 5/6 Verifying : 1:mariadb-libs-5.5.68-1.el7.x86_64 6/6 Installed: mysql-community-libs.x86_64 0:5.7.40-1.el7 mysql-community-libs-compat.x86_64 0:5.7.40-1.el7 mysql-community-server.x86_64 0:5.7.40-1.el7 Dependency Installed: mysql-community-client.x86_64 0:5.7.40-1.el7 mysql-community-common.x86_64 0:5.7.40-1.el7 Replaced: mariadb-libs.x86_64 1:5.5.68-1.el7 Complete!
搞定!