当前位置:   article > 正文

解决安装Mysql失败:GPG密钥已安装,但是不适用于此软件包的问题_源 "mysql 8.0 community server" 的 gpg 密钥已安装,但是不适用于此

源 "mysql 8.0 community server" 的 gpg 密钥已安装,但是不适用于此软件包。请检
  • 平台:阿里云ECS

  • 操作系统:CentOS-7\CentOS-8

  • 操作步骤:

    wget http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm  
    yum -y install mysql57-community-release-el7-10.noarch.rpm  
    #执行这条语句的时候报错
    yum -y install mysql-community-server 
    
         
         
    • 1
    • 2
    • 3
    • 4
    • 1
    • 2
    • 3
    • 4
  • 报错信息:

    从 file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql 检索密钥
    源 "MySQL 5.7 Community Server" 的 GPG 密钥已安装,但是不适用于此软件包。请检查源的公钥 URL 是否配置正确。
    失败的软件包是:mysql-community-server-5.7.37-1.el7.x86_64
    GPG  密钥配置为:file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
    
         
         
    • 1
    • 2
    • 3
    • 4
    • 1
    • 2
    • 3
    • 4
  • 解决方案:

    GPG验证不通过,我理解是本机配置的这个软件包对应的公钥不对,签名验证失败。(我也不知道这个公钥是在安装过程哪一步自动配置的)。我在mysql官网搜关键字GPG,找到了解决方案,大意是如果使用的4.1以上版本的rpm的话,除了import mysql的公钥到个人用户的配置中,还需要import mysql的公钥到RPM的配置中。

  • 原文:

    If you are using RPM 4.1 and it complains about (GPG) NOT OK (MISSING KEYS: GPG#3a79bd29), even though you have imported the MySQL public build key into your own GPG keyring, you need to import the key into the RPM keyring first. RPM 4.1 no longer uses your personal GPG keyring (or GPG itself). Rather, RPM maintains a separate keyring because it is a system-wide application and a user’s GPG public keyring is a user-specific file. To import the MySQL public key into the RPM keyring, first obtain the key, then use rpm --import to import the key. For example:

    $> gpg --export -a 3a79bd29 > 3a79bd29.asc
    $> rpm --import 3a79bd29.asc
    
         
         
    • 1
    • 2
    • 1
    • 2

    Alternatively, rpm also supports loading the key directly from a URL:

    $> rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022
    
         
         
    • 1
    • 1
  • 备注:以上原文命令只适用于mysql5.7,其他版本请点击原文链接,选择相应版本,查看解决方案

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/2023面试高手/article/detail/673308
推荐阅读
相关标签
  

闽ICP备14008679号