一、判断是否已安装MYSQL
which mysql
which mysqldump
输出如下内容表示未安装
[root@qbi-executor-01 mysql]# which mysql
[root@qbi-executor-01 mysql]# which mysqldump
输入如下内容表示已安装
[root@centos6 ~]# which mysql
/usr/bin/mysql
[root@centos6 ~]# which mysqldump
/usr/bin/mysqldump
二、安装mysql客户端
[root@qbi-executor-01 mysql]# yum install mysql-community-server --nogpgcheck
[root@qbi-executor-01 mysql]# yum install mysql-community-server --nogpgcheck
Loaded plugins: fastestmirror, langpacks, releasever-adapter, update-motd
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package mysql-community-server.x86_64 0:5.7.38-1.el7 will be installed
--> Processing Dependency: mysql-community-common(x86-64) = 5.7.38-1.el7 for package: mysql-community-server-5.7.38-1.el7.x86_64
--> Processing Dependency: mysql-community-client(x86-64) >= 5.7.9 for package: mysql-community-server-5.7.38-1.el7.x86_64
--> Running transaction check
---> Package mysql-community-client.x86_64 0:5.7.38-1.el7 will be installed
--> Processing Dependency: mysql-community-libs(x86-64) >= 5.7.9 for package: mysql-community-client-5.7.38-1.el7.x86_64
---> Package mysql-community-common.x86_64 0:5.7.38-1.el7 will be installed
--> Running transaction check
---> Package mariadb-libs.x86_64 1:5.5.68-1.1.al7 will be obsoleted
--> Processing Dependency: libmysqlclient.so.18()(64bit) for package: 2:postfix-2.10.1-9.1.al7.x86_64
--> Processing Dependency: libmysqlclient.so.18(libmysqlclient_18)(64bit) for package: 2:postfix-2.10.1-9.1.al7.x86_64
---> Package mysql-community-libs.x86_64 0:5.7.38-1.el7 will be obsoleting
--> Running transaction check
---> Package mysql-community-libs-compat.x86_64 0:5.7.38-1.el7 will be obsoleting
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
mysql-community-libs x86_64 5.7.38-1.el7 mysql57-community 2.6 M
replacing mariadb-libs.x86_64 1:5.5.68-1.1.al7
mysql-community-libs-compat x86_64 5.7.38-1.el7 mysql57-community 1.2 M
replacing mariadb-libs.x86_64 1:5.5.68-1.1.al7
mysql-community-server x86_64 5.7.38-1.el7 mysql57-community 178 M
Installing for dependencies:
mysql-community-client x86_64 5.7.38-1.el7 mysql57-community 28 M
mysql-community-common x86_64 5.7.38-1.el7 mysql57-community 311 k
Transaction Summary
================================================================================
Install 3 Packages (+2 Dependent packages)
Total size: 209 M
Total download size: 178 M
Is this ok [y/d/N]: y
Downloading packages:
mysql-community-server-5.7.38-1.el7.x86_64.rpm | 178 MB 00:16
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Warning: RPMDB altered outside of yum.
Installing : mysql-community-common-5.7.38-1.el7.x86_64 1/6
Installing : mysql-community-libs-5.7.38-1.el7.x86_64 2/6
Installing : mysql-community-client-5.7.38-1.el7.x86_64 3/6
Installing : mysql-community-server-5.7.38-1.el7.x86_64 4/6
Installing : mysql-community-libs-compat-5.7.38-1.el7.x86_64 5/6
Erasing : 1:mariadb-libs-5.5.68-1.1.al7.x86_64 6/6
Verifying : mysql-community-libs-compat-5.7.38-1.el7.x86_64 1/6
Verifying : mysql-community-client-5.7.38-1.el7.x86_64 2/6
Verifying : mysql-community-server-5.7.38-1.el7.x86_64 3/6
Verifying : mysql-community-common-5.7.38-1.el7.x86_64 4/6
Verifying : mysql-community-libs-5.7.38-1.el7.x86_64 5/6
Verifying : 1:mariadb-libs-5.5.68-1.1.al7.x86_64 6/6
Installed:
mysql-community-libs.x86_64 0:5.7.38-1.el7
mysql-community-libs-compat.x86_64 0:5.7.38-1.el7
mysql-community-server.x86_64 0:5.7.38-1.el7
Dependency Installed:
mysql-community-client.x86_64 0:5.7.38-1.el7
mysql-community-common.x86_64 0:5.7.38-1.el7
Replaced:
mariadb-libs.x86_64 1:5.5.68-1.1.al7
Complete!
测试
再次测试安装情况,步骤同(一、判断是否已安装MYSQL)
命令:which mysql
命令:which mysqldump