redhat5.432位安装mysql5.6.17数据库及创建数据库实例、配置编码、卸载(七)

2015-02-02 23:12:07 · 作者: · 浏览: 57
alhost home]# mysql -uroot -proot mysql> use myDbNamemysql> show variables like '%set%' -> ;+---------------------------------------+----------------------------+ | Variable_name???????????????????????? | Value????????????????????? | +---------------------------------------+----------------------------+ | auto_increment_offset???????????????? | 1????????????????????????? | | character_set_client????????????????? | utf8?????????????????????? | | character_set_connection????????????? | utf8?????????????????????? | | character_set_database??????????????? | utf8?????????????????????? | | character_set_filesystem????????????? | binary???????????????????? | | character_set_results???????????????? | utf8?????????????????????? | | character_set_server????????????????? | latin1???????????????????? | | character_set_system????????????????? | utf8?????????????????????? | | character_sets_dir??????????????????? | /usr/share/mysql/charsets/ | | innodb_monitor_reset????????????????? |??????????????????????????? | | innodb_monitor_reset_all????????????? |??????????????????????????? | | optimizer_trace_offset??????????????? | -1???????????????????????? | | performance_schema_setup_actors_size? | 100??????????????????????? | | performance_schema_setup_objects_size | 100??????????????????????? | +---------------------------------------+----------------------------+ 14 rows in set (0.00 sec)

status命令:

mysql> status
--------------
mysql  Ver 14.14 Distrib 5.6.17, for Linux (i686) using  EditLine wrapper

Connection id:        2
Current database:     myDbName
Current user:   root@
SSL:            Not in use
Current pager:        stdout
Using outfile:        ''
Using delimiter:      ;
Server version:       5.6.17 MySQL Community Server (GPL)
Protocol version:     10
Connection:     Localhost via UNIX socket
Server characterset:  latin1
Db     characterset:  utf8
Client characterset:  utf8
Conn.  characterset:  utf8
UNIX socket:    /var/lib/mysql/mysql.sock
Uptime:         1 hour 19 min 38 sec

Threads: 1  Questions: 43  Slow queries: 0  Opens: 76  Flush tables: 1  Open tables: 71  Queries per second avg: 0.008
-------------

四、mysql驱动版本不匹配问题:

在使用sqlyog(mysql驱动版本较低)操作mysql 6所建数据库时,可能会报出如下问题:

Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'OPTION SQL_SELECT_LIMIT=DEFAULT' at line 1
SQLState:  42000
ErrorCode: 1064
mysql6移除了mysql5中的该项设置,所以有两种方案,一替换为高版本驱动,另一种更换mysql数据库为mysql5或更低版本。

附:查询数据库版本:

mysql> select version();
+-----------+
| version() |
+-----------+
| 5.6.17    |
+-----------+
1 row in set (0.00 sec)

mysql> 

五、如何卸载?

以下为rpm安装方式的mysql的卸载过程:

5.1、查看已经安装的mysql rpm包
[root@localhost home]# rpm -qa | grep My
MySQL-server-5.6.17-1.linux_glibc2.5
MySQL-client-5.6.17-1.linux_glibc2.5
[root@localhost home]# 

5.2、停止mysql服务:

[root@localhost ~]# service mysql stop
Shutting down MySQL..????????????????????????????????????? [确定]
5.2、删除 已经安装的mysql包 ,不带rpm结尾,为上面命令5.1中查找的结果:

先卸载客户端:

[root@localhost ~]# rpm -e MySQL-client-5.6.17-1.linux_glibc2.5.i386
root@localhost ~]# 

接着卸载其他相关包,如mysql开发包:

[root@localhost ~]# rpm -e MySQL-devel-5.6.17-1.linux_glibc2.5
[root@localhost ~]# 

最后卸载服务端:

[root@localhost ~]# rpm -e MySQL-server-5.