当前位置: 首页 > 工具软件 > MySQL Client > 使用案例 >

linux 利用yum源安装mysql client 5.7

向杜吟
2023-12-01

前言

  • CentOS Linux release 7.6.1810
  • mysql client 5.7.x

步骤

  1. 添加mysql源

    shell> rpm -ivh http://repo.mysql.com/mysql57-community-release-el7-10.noarch.rpm
    Retrieving http://repo.mysql.com/mysql57-community-release-el7-10.noarch.rpm
    Preparing...                          ################################# [100%]
    Updating / installing...
       1:mysql57-community-release-el7-10 ################################# [100%]
    

    注:卸载mysql源 rpm -e --nodeps mysql57-community-release-el7-10.noarch

  2. 查看mysql源中的mysql client版本

    shell> yum info mysql-community-client
    Available Packages
    Name        : mysql-community-client
    Arch        : i686
    Version     : 5.7.40
    Release     : 1.el7
    Size        : 27 M
    Repo        : mysql57-community/x86_64
    Summary     : MySQL database client applications and tools
    URL         : http://www.mysql.com/
    License     : Copyright (c) 2000, 2022, Oracle and/or its affiliates. All rights reserved. Under GPLv2 license as shown in the Description field.
    Description : This package contains the standard MySQL clients and administration
                : tools.
    
    Name        : mysql-community-client
    Arch        : x86_64
    Version     : 5.7.40
    Release     : 1.el7
    Size        : 28 M
    Repo        : mysql57-community/x86_64
    Summary     : MySQL database client applications and tools
    URL         : http://www.mysql.com/
    License     : Copyright (c) 2000, 2022, Oracle and/or its affiliates. All rights reserved. Under GPLv2 license as shown in the Description field.
    Description : This package contains the standard MySQL clients and administration
                : tools.
    
  3. 安装mysql

    shell> yum install mysql-community-client
    
  4. 检查是否安装成功

shell> mysql -V
mysql  Ver 14.14 Distrib 5.7.40, for Linux (x86_64) using  EditLine wrapper

Public key for mysql-community-libs-compat-5.7.40-1.el7.x86_64.rpm is not installed

Public key for mysql-community-libs-compat-5.7.40-1.el7.x86_64.rpm is not installed


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

修改 gpgcheck=1 => gpgcheck=0

卸载步骤

查询已安装的rpm

shell> rpm -qa|grep  mysql
mysql-community-libs-5.7.40-1.el7.x86_64
mysql57-community-release-el7-10.noarch
mysql-community-common-5.7.40-1.el7.x86_64
mysql-community-libs-compat-5.7.40-1.el7.x86_64

逐一卸载

shell> yum -y remove  mysql-community-common-5.7.40-1.el7.x86_64
shell> yum -y remove mysql57-community-release-el7-10.noarch
shell> yum -y remove  mysql-community-libs-compat-5.7.40-1.el7.x86_64
shell> yum -y remove  mysql-community-libs-5.7.40-1.el7.x86_64
 类似资料: