一、判斷是否已安裝MYSQL
which mysql
which mysqldump
輸出如下內(nèi)容表示未安裝
[root@centos6 ~]# which mysql
/usr/bin/which: no mysql in (/usr/local/sbin:/usr/local/bin
:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin)
[root@centos6 ~]# which mysqldump
/usr/bin/which: no mysqldump in (/usr/local/sbin
:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin)
輸入如下內(nèi)容表示已安裝
[root@centos6 ~]# which mysql
/usr/bin/mysql
[root@centos6 ~]# which mysqldump
/usr/bin/mysqldump
二黄绩、安裝mysql客戶端
yum install mysql
再次測(cè)試安裝情況羡洁,步驟同(一、判斷是否已安裝MYSQL)
which mysql
which mysqldump
三爽丹、操作全過程
[root@centos6 ~]# which mysql
/usr/bin/which: no mysql in (/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin)
[root@centos6 ~]# which mysqldump
/usr/bin/which: no mysqldump in (/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin)
[root@centos6 ~]# yum install mysql
已加載插件:fastestmirror
設(shè)置安裝進(jìn)程
Loading mirror speeds from cached hostfile
* webtatic: us-east.repo.webtatic.com
解決依賴關(guān)系
--> 執(zhí)行事務(wù)檢查
---> Package mysql.x86_64 0:5.1.73-8.el6_8 will be 安裝
--> 完成依賴關(guān)系計(jì)算
依賴關(guān)系解決
==============================================================================================================================================
軟件包 架構(gòu) 版本 倉(cāng)庫(kù) 大小
==============================================================================================================================================
正在安裝:
mysql x86_64 5.1.73-8.el6_8 base 895 k
事務(wù)概要
==============================================================================================================================================
Install 1 Package(s)
總下載量:895 k
Installed size: 2.4 M
確定嗎筑煮?[y/N]:y
下載軟件包:
mysql-5.1.73-8.el6_8.x86_64.rpm | 895 kB 00:00
運(yùn)行 rpm_check_debug
執(zhí)行事務(wù)測(cè)試
事務(wù)測(cè)試成功
執(zhí)行事務(wù)
正在安裝 : mysql-5.1.73-8.el6_8.x86_64 1/1
Verifying : mysql-5.1.73-8.el6_8.x86_64 1/1
已安裝:
mysql.x86_64 0:5.1.73-8.el6_8
完畢!
[root@centos6 ~]# which mysql
/usr/bin/mysql
[root@centos6 ~]# which mysqldump
/usr/bin/mysqldump
[root@centos6 ~]# mysql -u root -p -h 127.0.0.1
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 17561945
Server version: 5.6.34 Source distribution
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> show databases
-> ;
+--------------------+
| Database |
+--------------------+
| information_schema |
| db_speaker_server |
| mysql |
| performance_schema |
+--------------------+
5 rows in set (0.00 sec)
mysql> exit;
Bye
[root@centos6 ~]#