linux 利用yum源安装mysql client 5.7

本文介绍了如何在CentOS 7.6系统中安装MySQL 5.7.x版本的客户端。内容包括添加MySQL软件源、安装MySQL客户端、验证安装以及卸载步骤等。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

前言

  • 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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值