无法用指定MySQL客户端登陆服务器的案例分析(3)

再次查看,现在使用的配置文件已经为默认配置的值了(可与之前的进程捕捉到的路径做对比),RPM包安装MySQL默认的data路径是/var/lib/mysql,bin log和error log默认也都是放在这里的

 

二、安装MySQL客户端

 

由于之前已经装了5.5.39的二进制MySQL,如果不安装5.0.96的客户端,而直接使用原来的客户端也是可以的,那么就是通过5.5.39的客户端去连接5.0.96的服务器

 

[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, 2014, 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.14 Distrib 5.5.39, for linux2.6 (i686) using readline 5.1

 

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:    utf8

Conn.  characterset:    utf8

UNIX socket:            /var/lib/mysql/mysql.sock

Uptime:                 1 min 5 sec

 

Threads: 1  Questions: 4  Slow queries: 0  Opens: 12  Flush tables: 1  Open tables: 6  Queries per second avg: 0.062

--------------

 

mysql> 

 

连接很顺利,红色部分清楚地显示了客户端和服务器端的版本号,如果在没有安装过MySQL客户端的系统上执行mysql,会提示找不到命令,我的目的是想安装5.0.96自己的客户端,然后连接到服务器

 

[root@bak ~]# rpm -ivh /opt/MySQL-client-community-5.0.96-1.rhel5.i386.rpm 

Preparing...                ########################################### [100%]

   1:MySQL-client-community ########################################### [100%]

[root@bak ~]# 

 

为了不让原来的��本对5.0.39产生干扰,我把原来属于5.5.39的软链先删掉

 

[root@bak ~]# cd /usr/local

[root@bak local]# ll

total 72

drwxr-xr-x 2 mysql  502 4096 Aug 25 11:39 bin

drwxr-xr-x 2 mysql  502 4096 Aug  8  2008 etc

drwxr-xr-x 2 mysql  502 4096 Aug  8  2008 games

drwxr-xr-x 2 mysql  502 4096 Aug  8  2008 include

drwxr-xr-x 2 mysql  502 4096 Aug  8  2008 lib

drwxr-xr-x 2 mysql  502 4096 Aug  8  2008 libexec

lrwxrwxrwx 1 root  root   38 Oct 17 14:56 mysql -> /opt/mysql/mysql-5.5.39-linux2.6-i686/

drwxr-xr-x 2 mysql  502 4096 Aug  8  2008 sbin

drwxr-xr-x 5 mysql  502 4096 Aug 25 11:39 share

drwxr-xr-x 2 mysql  502 4096 Sep 23 20:34 src

[root@bak local]# unlink mysql

[root@bak local]# ll

total 72

drwxr-xr-x 2 mysql 502 4096 Aug 25 11:39 bin

drwxr-xr-x 2 mysql 502 4096 Aug  8  2008 etc

drwxr-xr-x 2 mysql 502 4096 Aug  8  2008 games

drwxr-xr-x 2 mysql 502 4096 Aug  8  2008 include

drwxr-xr-x 2 mysql 502 4096 Aug  8  2008 lib

drwxr-xr-x 2 mysql 502 4096 Aug  8  2008 libexec

drwxr-xr-x 2 mysql 502 4096 Aug  8  2008 sbin

drwxr-xr-x 5 mysql 502 4096 Aug 25 11:39 share

drwxr-xr-x 2 mysql 502 4096 Sep 23 20:34 src

[root@bak local]# 

 

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/209eb7c89bdb1b28ad704950da12e930.html