在一台新的 centOS 6.5 服务器上,想要运行 MySQL 客户端,却被告之无法识别。
本文介绍如何只安装 MySQL 客户端。

1
2
# mysql
-bash: mysql: command not found

检查是否已经安装 mysql

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# find / -name mysql
/usr/lib64/mysql
/usr/share/mysql
[root@jstukte7a334ry mysql]# cd /usr/lib64/mysql/
[root@jstukte7a334ry mysql]# ll
total 3108
lrwxrwxrwx. 1 root root 26 Aug 14 2014 libmysqlclient_r.so.16 -> libmysqlclient_r.so.16.0.0
-rwxr-xr-x. 1 root root 1595240 Feb 13 2014 libmysqlclient_r.so.16.0.0
lrwxrwxrwx. 1 root root 24 Aug 14 2014 libmysqlclient.so.16 -> libmysqlclient.so.16.0.0
-rwxr-xr-x. 1 root root 1584680 Feb 13 2014 libmysqlclient.so.16.0.0
[root@jstukte7a334ry mysql]# cd /usr/share/mysql/
[root@jstukte7a334ry mysql]# ll
total 96
drwxr-xr-x. 2 root root 4096 Aug 14 2014 charsets
drwxr-xr-x. 2 root root 4096 Aug 14 2014 czech
drwxr-xr-x. 2 root root 4096 Aug 14 2014 danish
drwxr-xr-x. 2 root root 4096 Aug 14 2014 dutch
drwxr-xr-x. 2 root root 4096 Aug 14 2014 english
drwxr-xr-x. 2 root root 4096 Aug 14 2014 estonian
drwxr-xr-x. 2 root root 4096 Aug 14 2014 french
drwxr-xr-x. 2 root root 4096 Aug 14 2014 german
drwxr-xr-x. 2 root root 4096 Aug 14 2014 greek
drwxr-xr-x. 2 root root 4096 Aug 14 2014 hungarian
drwxr-xr-x. 2 root root 4096 Aug 14 2014 italian
drwxr-xr-x. 2 root root 4096 Aug 14 2014 japanese
drwxr-xr-x. 2 root root 4096 Aug 14 2014 korean
drwxr-xr-x. 2 root root 4096 Aug 14 2014 norwegian
drwxr-xr-x. 2 root root 4096 Aug 14 2014 norwegian-ny
drwxr-xr-x. 2 root root 4096 Aug 14 2014 polish
drwxr-xr-x. 2 root root 4096 Aug 14 2014 portuguese
drwxr-xr-x. 2 root root 4096 Aug 14 2014 romanian
drwxr-xr-x. 2 root root 4096 Aug 14 2014 russian
drwxr-xr-x. 2 root root 4096 Aug 14 2014 serbian
drwxr-xr-x. 2 root root 4096 Aug 14 2014 slovak
drwxr-xr-x. 2 root root 4096 Aug 14 2014 spanish
drwxr-xr-x. 2 root root 4096 Aug 14 2014 swedish
drwxr-xr-x. 2 root root 4096 Aug 14 2014 ukrainian
[root@jstukte7a334ry mysql]# service mysqld status
mysqld: unrecognized service
[root@jstukte7a334ry mysql]# service mysql status
mysql: unrecognized service
[root@jstukte7a334ry mysql]# cd /etc/init.d/
[root@jstukte7a334ry init.d]# ll
total 256
-rwxr-xr-x. 1 root root 1288 Nov 23 2013 abrt-ccpp
-rwxr-xr-x. 1 root root 1628 Nov 23 2013 abrtd
-rwxr-xr-x. 1 root root 1642 Nov 23 2013 abrt-oops
-rwxr-xr-x. 1 root root 1725 Aug 19 2010 acpid
-rwxr-xr-x 1 root root 2265 Jun 28 2016 aegis
-r-xr-xr-x 1 root root 3726 Jun 2 2015 agentwatch
-rwxrwxrwx 1 root root 3864 Jul 5 2016 ali_auditd_srv
-rwxr-xr-x. 1 root root 2062 Jan 30 2012 atd
-rwxr-xr-x. 1 root root 3378 May 28 2014 auditd
-r-xr-xr-x. 1 root root 1340 Nov 24 2013 blk-availability
-rwxr-xr-x. 1 root root 11355 Aug 13 2013 cpuspeed
-rwxr-xr-x. 1 root root 2826 Nov 23 2013 crond
-rw-r--r--. 1 root root 19175 Jul 10 2014 functions
-rwxr-xr-x. 1 root root 1801 Jul 20 2011 haldaemon
-rwxr-xr-x. 1 root root 5866 Oct 10 2013 halt
-rwxr-xr-x. 1 root root 10804 Nov 23 2013 ip6tables
-rwxr-xr-x. 1 root root 10688 Nov 23 2013 iptables
-rwxr-xr-x. 1 root root 1938 May 5 2014 irqbalance
-rwxr-xr-x. 1 root root 18133 Nov 23 2013 kdump
-rwxr-xr-x. 1 root root 652 Oct 10 2013 killall
-r-xr-xr-x. 1 root root 2134 Nov 24 2013 lvm2-lvmetad
-r-xr-xr-x. 1 root root 2665 Nov 24 2013 lvm2-monitor
-rwxr-xr-x. 1 root root 2571 Apr 7 2014 mdmonitor
-rwxr-xr-x. 1 root root 2200 Sep 14 2012 messagebus
-rwxr-xr-x. 1 root root 2989 Oct 10 2013 netconsole
-rwxr-xr-x. 1 root root 5428 Oct 10 2013 netfs
-rwxr-xr-x. 1 root root 6334 Oct 10 2013 network
-rwxr-xr-x 1 root root 2515 Jan 28 2015 nscd
-rwxr-xr-x 1 root root 1923 Dec 20 2014 ntpd
-rwxr-xr-x 1 root root 2043 Dec 20 2014 ntpdate
-rwxrwxrwx 1 root root 1459 Mar 10 20:35 openvpnsrv
-rwxr-xr-x. 1 root root 3912 Feb 20 2014 postfix
-rwxr-xr-x. 1 root root 1556 Jul 17 2012 psacct
-rwxr-xr-x. 1 root root 2034 Mar 5 2014 quota_nld
-rwxr-xr-x. 1 root root 1513 Sep 17 2013 rdisc
-rwxr-xr-x. 1 root root 1822 Nov 23 2013 restorecond
-rwxr-xr-x. 1 root root 1808 Dec 18 2011 rngd
-rwxr-xr-x. 1 root root 2011 Aug 15 2013 rsyslog
-rwxr-xr-x. 1 root root 1698 Nov 23 2013 sandbox
-rwxr-xr-x. 1 root root 2056 Nov 20 2012 saslauthd
-rwxr-xr-x. 1 root root 647 Oct 10 2013 single
-rwxr-xr-x. 1 root root 3002 Feb 22 2013 smartd
-rwxr-xr-x. 1 root root 4534 Nov 23 2013 sshd
-rwxr-xr-x. 1 root root 2276 Feb 12 2014 svnserve
-rwxr-xr-x 1 root root 1144 Oct 16 2014 sysstat
-rwxr-xr-x. 1 root root 2294 Nov 23 2013 udev-post
[root@jstukte7a334ry init.d]# ll mysql*
ls: cannot access mysql*: No such file or directory

通过以上检查,服务列表没有mysql,相关的目录下也没有mysql可执行程序,确保系统没有安装 mysql,那么,安装之。

下载最新的 MySQL Community Server

centos 要选 Red Hat Enterprise Linux / Oracle Linux,然后,要选 el6 的版本。linux 版本号中 EL 代表 enterprise linux

1
2
3
4
5
6
7
What does el5, el6, and el7 mean?
EL is short for Red Hat Enterprise Linux (EL).
EL5 is the download for Red Hat 5.x, CentOS 5.x, CloudLinux 5.x.
EL6 is the download for Red Hat 6.x, CentOS 6.x, and CloudLinux 6.x.
EL7 is the download for Red Hat 7.x, CentOS 7.x, and CloudLinux 7.x.

The UNIXy Varnish Plugins run on all the above platforms.

我下载的最新版本是:mysql-5.7.18-1.el6.x86_64.rpm-bundle.tar
下载后,解压:

1
tar -xvf mysql-5.7.18-1.el6.x86_64.rpm-bundle.tar

得到以下文件列表:

1
2
3
4
5
6
7
8
9
10
11
12
# ll
total 918984
-rw-r--r-- 1 root root 470507520 Mar 20 18:52 mysql-5.7.18-1.el6.x86_64.rpm-bundle.tar
-rw-r--r-- 1 7155 31415 23618836 Mar 20 17:40 mysql-community-client-5.7.18-1.el6.x86_64.rpm
-rw-r--r-- 1 7155 31415 335496 Mar 20 17:40 mysql-community-common-5.7.18-1.el6.x86_64.rpm
-rw-r--r-- 1 7155 31415 3747352 Mar 20 17:40 mysql-community-devel-5.7.18-1.el6.x86_64.rpm
-rw-r--r-- 1 7155 31415 39086508 Mar 20 17:40 mysql-community-embedded-5.7.18-1.el6.x86_64.rpm
-rw-r--r-- 1 7155 31415 135869292 Mar 20 17:40 mysql-community-embedded-devel-5.7.18-1.el6.x86_64.rpm
-rw-r--r-- 1 7155 31415 2177064 Mar 20 17:40 mysql-community-libs-5.7.18-1.el6.x86_64.rpm
-rw-r--r-- 1 7155 31415 1723180 Mar 20 17:40 mysql-community-libs-compat-5.7.18-1.el6.x86_64.rpm
-rw-r--r-- 1 7155 31415 159060212 Mar 20 17:41 mysql-community-server-5.7.18-1.el6.x86_64.rpm
-rw-r--r-- 1 7155 31415 104881084 Mar 20 17:41 mysql-community-test-5.7.18-1.el6.x86_64.rpm

安装client 需要先安装 libs

1
2
3
4
# rpm -ivh mysql-community-client-5.7.18-1.el6.x86_64.rpm
warning: mysql-community-client-5.7.18-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
error: Failed dependencies:
mysql-community-libs(x86-64) >= 5.7.9 is needed by mysql-community-client-5.7.18-1.el6.x86_64

而安装 libs 需要先安装 common

1
2
3
4
# rpm -ivh mysql-community-libs-5.7.18-1.el6.x86_64.rpm 
warning: mysql-community-libs-5.7.18-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
error: Failed dependencies:
mysql-community-common(x86-64) >= 5.7.9 is needed by mysql-community-libs-5.7.18-1.el6.x86_64

所以,最先被安装的,应该是 common

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# rpm -ivh mysql-community-common-5.7.18-1.el6.x86_64.rpm
warning: mysql-community-common-5.7.18-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing... ########################################### [100%]
file /usr/share/mysql/czech/errmsg.sys from install of mysql-community-common-5.7.18-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.73-3.el6_5.x86_64
file /usr/share/mysql/danish/errmsg.sys from install of mysql-community-common-5.7.18-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.73-3.el6_5.x86_64
file /usr/share/mysql/dutch/errmsg.sys from install of mysql-community-common-5.7.18-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.73-3.el6_5.x86_64
file /usr/share/mysql/english/errmsg.sys from install of mysql-community-common-5.7.18-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.73-3.el6_5.x86_64
file /usr/share/mysql/estonian/errmsg.sys from install of mysql-community-common-5.7.18-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.73-3.el6_5.x86_64
file /usr/share/mysql/french/errmsg.sys from install of mysql-community-common-5.7.18-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.73-3.el6_5.x86_64
file /usr/share/mysql/german/errmsg.sys from install of mysql-community-common-5.7.18-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.73-3.el6_5.x86_64
file /usr/share/mysql/greek/errmsg.sys from install of mysql-community-common-5.7.18-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.73-3.el6_5.x86_64
file /usr/share/mysql/hungarian/errmsg.sys from install of mysql-community-common-5.7.18-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.73-3.el6_5.x86_64
file /usr/share/mysql/italian/errmsg.sys from install of mysql-community-common-5.7.18-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.73-3.el6_5.x86_64
file /usr/share/mysql/japanese/errmsg.sys from install of mysql-community-common-5.7.18-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.73-3.el6_5.x86_64
file /usr/share/mysql/korean/errmsg.sys from install of mysql-community-common-5.7.18-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.73-3.el6_5.x86_64
file /usr/share/mysql/norwegian-ny/errmsg.sys from install of mysql-community-common-5.7.18-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.73-3.el6_5.x86_64
file /usr/share/mysql/norwegian/errmsg.sys from install of mysql-community-common-5.7.18-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.73-3.el6_5.x86_64
file /usr/share/mysql/polish/errmsg.sys from install of mysql-community-common-5.7.18-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.73-3.el6_5.x86_64
file /usr/share/mysql/portuguese/errmsg.sys from install of mysql-community-common-5.7.18-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.73-3.el6_5.x86_64
file /usr/share/mysql/romanian/errmsg.sys from install of mysql-community-common-5.7.18-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.73-3.el6_5.x86_64
file /usr/share/mysql/russian/errmsg.sys from install of mysql-community-common-5.7.18-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.73-3.el6_5.x86_64
file /usr/share/mysql/serbian/errmsg.sys from install of mysql-community-common-5.7.18-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.73-3.el6_5.x86_64
file /usr/share/mysql/slovak/errmsg.sys from install of mysql-community-common-5.7.18-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.73-3.el6_5.x86_64
file /usr/share/mysql/spanish/errmsg.sys from install of mysql-community-common-5.7.18-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.73-3.el6_5.x86_64
file /usr/share/mysql/swedish/errmsg.sys from install of mysql-community-common-5.7.18-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.73-3.el6_5.x86_64
file /usr/share/mysql/ukrainian/errmsg.sys from install of mysql-community-common-5.7.18-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.73-3.el6_5.x86_64
file /usr/share/mysql/charsets/Index.xml from install of mysql-community-common-5.7.18-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.73-3.el6_5.x86_64
file /usr/share/mysql/charsets/armscii8.xml from install of mysql-community-common-5.7.18-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.73-3.el6_5.x86_64
file /usr/share/mysql/charsets/ascii.xml from install of mysql-community-common-5.7.18-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.73-3.el6_5.x86_64
file /usr/share/mysql/charsets/cp1250.xml from install of mysql-community-common-5.7.18-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.73-3.el6_5.x86_64
file /usr/share/mysql/charsets/cp1256.xml from install of mysql-community-common-5.7.18-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.73-3.el6_5.x86_64
file /usr/share/mysql/charsets/cp1257.xml from install of mysql-community-common-5.7.18-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.73-3.el6_5.x86_64
file /usr/share/mysql/charsets/cp850.xml from install of mysql-community-common-5.7.18-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.73-3.el6_5.x86_64
file /usr/share/mysql/charsets/cp852.xml from install of mysql-community-common-5.7.18-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.73-3.el6_5.x86_64
file /usr/share/mysql/charsets/cp866.xml from install of mysql-community-common-5.7.18-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.73-3.el6_5.x86_64
file /usr/share/mysql/charsets/dec8.xml from install of mysql-community-common-5.7.18-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.73-3.el6_5.x86_64
file /usr/share/mysql/charsets/geostd8.xml from install of mysql-community-common-5.7.18-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.73-3.el6_5.x86_64
file /usr/share/mysql/charsets/greek.xml from install of mysql-community-common-5.7.18-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.73-3.el6_5.x86_64
file /usr/share/mysql/charsets/hebrew.xml from install of mysql-community-common-5.7.18-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.73-3.el6_5.x86_64
file /usr/share/mysql/charsets/hp8.xml from install of mysql-community-common-5.7.18-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.73-3.el6_5.x86_64
file /usr/share/mysql/charsets/keybcs2.xml from install of mysql-community-common-5.7.18-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.73-3.el6_5.x86_64
file /usr/share/mysql/charsets/koi8r.xml from install of mysql-community-common-5.7.18-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.73-3.el6_5.x86_64
file /usr/share/mysql/charsets/koi8u.xml from install of mysql-community-common-5.7.18-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.73-3.el6_5.x86_64
file /usr/share/mysql/charsets/latin1.xml from install of mysql-community-common-5.7.18-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.73-3.el6_5.x86_64
file /usr/share/mysql/charsets/latin2.xml from install of mysql-community-common-5.7.18-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.73-3.el6_5.x86_64
file /usr/share/mysql/charsets/latin5.xml from install of mysql-community-common-5.7.18-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.73-3.el6_5.x86_64
file /usr/share/mysql/charsets/latin7.xml from install of mysql-community-common-5.7.18-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.73-3.el6_5.x86_64
file /usr/share/mysql/charsets/macce.xml from install of mysql-community-common-5.7.18-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.73-3.el6_5.x86_64
file /usr/share/mysql/charsets/macroman.xml from install of mysql-community-common-5.7.18-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.73-3.el6_5.x86_64
file /usr/share/mysql/charsets/swe7.xml from install of mysql-community-common-5.7.18-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.73-3.el6_5.x86_64

安装过程中,提示与 centos6.5 自带的旧版本冲突。 解决:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# yum -y remove mysql-libs-5.1.73*
Loaded plugins: security
Setting up Remove Process
Resolving Dependencies
--> Running transaction check
---> Package mysql-libs.x86_64 0:5.1.73-3.el6_5 will be erased
--> Processing Dependency: libmysqlclient.so.16()(64bit) for package: 2:postfix-2.6.6-6.el6_5.x86_64
--> Processing Dependency: libmysqlclient.so.16(libmysqlclient_16)(64bit) for package: 2:postfix-2.6.6-6.el6_5.x86_64
--> Processing Dependency: mysql-libs for package: 2:postfix-2.6.6-6.el6_5.x86_64
--> Running transaction check
---> Package postfix.x86_64 2:2.6.6-6.el6_5 will be erased
--> Processing Dependency: /usr/sbin/sendmail for package: redhat-lsb-core-4.0-7.el6.centos.x86_64
--> Processing Dependency: /usr/sbin/sendmail for package: cronie-1.4.4-12.el6.x86_64
--> Running transaction check
---> Package cronie.x86_64 0:1.4.4-12.el6 will be erased
--> Processing Dependency: cronie = 1.4.4-12.el6 for package: cronie-anacron-1.4.4-12.el6.x86_64
---> Package redhat-lsb-core.x86_64 0:4.0-7.el6.centos will be erased
--> Running transaction check
---> Package cronie-anacron.x86_64 0:1.4.4-12.el6 will be erased
--> Processing Dependency: /etc/cron.d for package: crontabs-1.10-33.el6.noarch
--> Processing Dependency: /etc/cron.d for package: sysstat-9.0.4-27.el6.x86_64
--> Restarting Dependency Resolution with new changes.
--> Running transaction check
---> Package crontabs.noarch 0:1.10-33.el6 will be erased
---> Package sysstat.x86_64 0:9.0.4-27.el6 will be erased
--> Finished Dependency Resolution
base | 3.7 kB 00:00
epel | 4.3 kB 00:00
epel/primary_db | 5.9 MB 00:05
extras | 3.4 kB 00:00
updates | 3.4 kB 00:00

Dependencies Resolved

===================================================================================================================================
Package Arch Version Repository Size
===================================================================================================================================
Removing:
mysql-libs x86_64 5.1.73-3.el6_5 @updates 4.0 M
Removing for dependencies:
cronie x86_64 1.4.4-12.el6 @anaconda-CentOS-201311291202.x86_64/6.5 174 k
cronie-anacron x86_64 1.4.4-12.el6 @anaconda-CentOS-201311291202.x86_64/6.5 43 k
crontabs noarch 1.10-33.el6 @anaconda-CentOS-201311291202.x86_64/6.5 2.4 k
postfix x86_64 2:2.6.6-6.el6_5 @updates 9.7 M
redhat-lsb-core x86_64 4.0-7.el6.centos @anaconda-CentOS-201311291202.x86_64/6.5 22 k
sysstat x86_64 9.0.4-27.el6 @base 825 k

Transaction Summary
===================================================================================================================================
Remove 7 Package(s)

Installed size: 15 M
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Erasing : redhat-lsb-core-4.0-7.el6.centos.x86_64 1/7
Erasing : sysstat-9.0.4-27.el6.x86_64 2/7
/var/tmp/rpm-tmp.WcRV33: line 1: lsb_release: command not found
Erasing : cronie-1.4.4-12.el6.x86_64 3/7
Erasing : cronie-anacron-1.4.4-12.el6.x86_64 4/7
Erasing : crontabs-1.10-33.el6.noarch 5/7
Erasing : 2:postfix-2.6.6-6.el6_5.x86_64 6/7
Erasing : mysql-libs-5.1.73-3.el6_5.x86_64 7/7
Verifying : cronie-anacron-1.4.4-12.el6.x86_64 1/7
Verifying : mysql-libs-5.1.73-3.el6_5.x86_64 2/7
Verifying : redhat-lsb-core-4.0-7.el6.centos.x86_64 3/7
Verifying : sysstat-9.0.4-27.el6.x86_64 4/7
Verifying : crontabs-1.10-33.el6.noarch 5/7
Verifying : cronie-1.4.4-12.el6.x86_64 6/7
Verifying : 2:postfix-2.6.6-6.el6_5.x86_64 7/7

Removed:
mysql-libs.x86_64 0:5.1.73-3.el6_5

Dependency Removed:
cronie.x86_64 0:1.4.4-12.el6 cronie-anacron.x86_64 0:1.4.4-12.el6 crontabs.noarch 0:1.10-33.el6
postfix.x86_64 2:2.6.6-6.el6_5 redhat-lsb-core.x86_64 0:4.0-7.el6.centos sysstat.x86_64 0:9.0.4-27.el6

Complete!

再次安装

1
2
3
4
# rpm -ivh mysql-community-common-5.7.18-1.el6.x86_64.rpm
warning: mysql-community-common-5.7.18-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing... ########################################### [100%]
1:mysql-community-common ########################################### [100%]

然后是 libs

1
2
3
4
# rpm -ivh mysql-community-libs-5.7.18-1.el6.x86_64.rpm 
warning: mysql-community-libs-5.7.18-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing... ########################################### [100%]
1:mysql-community-libs ########################################### [100%]

最后是 client

1
2
3
4
# rpm -ivh mysql-community-client-5.7.18-1.el6.x86_64.rpm 
warning: mysql-community-client-5.7.18-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing... ########################################### [100%]
1:mysql-community-client ########################################### [100%]

再次查找 mysql

1
2
3
4
# find / -name mysql
/usr/lib64/mysql
/usr/share/mysql
/usr/bin/mysql

多了一个目录:/usr/bin/mysql

1
2
# cd /usr/bin/mysql
-bash: cd: /usr/bin/mysql: Not a directory

哈哈,这不是一个目录,这就是刚刚安装好的 mysql client
检查是否安装成功

1
2
# mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

看到上面的提示,说明 mysql 客户端已经安装成功了的。