原来的/usr/local/mysql/bin指向的位置是/opt/mysql/mysql-5.5.39-linux2.6-i686/mysql/bin的,那么按理说,现在已经取消了该路径,当我们执行mysql客户端命令的时候,应该是使用5.0.96的客户端程序去连接服务器,但事实却非如此
[root@bak local]# mysql
-bash: /usr/local/mysql/bin/mysql: No such file or directory
可以看到,当软链取消后,再次执行mysql命令,提示没有这个目录了,因为这个目录就是刚才软链的目录,已经unlink掉了,肯定是没有的了,那不是还有/usr/bin目录吗?为什么5.0.96自己的bin目录不能被利用起来?
开始以为重启mysqld进程可以改变这一窘境,可并没有起作用
[root@bak local]# service mysql stop
Shutting down MySQL. [ OK ]
[root@bak local]# service mysql start
Starting MySQL. [ OK ]
[root@bak local]# mysql
-bash: /usr/local/mysql/bin/mysql: No such file or directory
尝试退出session,重新连接到服务器
[root@bak local]# exit
断开session……
Last login: Fri Oct 17 15:26:24 2014 from 192.168.1.100 --重新连接上来
[root@bak ~]# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.0.96-community-log MySQL Community Edition (GPL)
Copyright (c) 2000, 2011, 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> \s
--------------
mysql Ver 14.12 Distrib 5.0.96, for pc-linux-gnu (i686) using readline 5.1 --不再报错,已经用5.0.96的客户端程序连到服务器了
Connection id: 1
Current database:
Current user: root@localhost
SSL: Not in use
Current pager: stdout
Using outfile: ''
Using delimiter: ;
Server version: 5.0.96-community-log MySQL Community Edition (GPL)
Protocol version: 10
Connection: Localhost via UNIX socket
Server characterset: latin1
Db characterset: latin1
Client characterset: latin1
Conn. characterset: latin1
UNIX socket: /var/lib/mysql/mysql.sock
Uptime: 1 min 55 sec
Threads: 1 Questions: 4 Slow queries: 0 Opens: 12 Flush tables: 1 Open tables: 6 Queries per second avg: 0.035
--------------
mysql>