mysql服务端编码设置
来源:未知 责任编辑:责任编辑 发表时间:2014-04-20 03:42 点击:次
安装完mysql,启动后发现服务器默认使用的是lat1编码.
具体操作和查看过程如下:
启动方式: /etc/init.d/mysql.server start
效果:
Database changed
mysql> status
--------------
mysql Ver 14.12 Distrib 5.0.77, for redhat-linux-gnu (x86_64) using readline 5.1
Connection id: 8
Current database: demodb
Current user: root@localhost
SSL: Not in use
Current pager: stdout
Using outfile: ''
Using delimiter: ;
Server version: 5.5.21 MySQL Community Server (GPL)
Protocol version: 10
Connection: Localhost via UNIX socket
Server characterset: latin1
Db characterset: utf8
Client characterset: latin1
Conn. characterset: latin1
UNIX socket: /var/lib/mysql/mysql.sock
Uptime: 33 sec
Threads: 7 Questions: 137 Slow queries: 0 Opens: 83 Flush tables: 1 Open tables: 76 Queries per second avg: 4.151
--------------
mysql>
启动方式: /etc/init.d/mysql.server start --character-set-server=utf8
效果:
mysql> use demodb;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> status;
--------------
mysql Ver 14.12 Distrib 5.0.77, for redhat-linux-gnu (x86_64) using readline 5.1
Connection id: 4
Current database: demodb
Current user: root@localhost
SSL: Not in use
Current pager: stdout
Using outfile: ''
Using delimiter: ;
Server version: 5.5.21 MySQL Community Server (GPL)
Protocol version: 10
Connection: Localhost via UNIX socket
Server characterset: utf8
Db characterset: utf8
Client characterset: latin1
Conn. characterset: latin1
具体操作和查看过程如下:
启动方式: /etc/init.d/mysql.server start
效果:
Database changed
mysql> status
--------------
mysql Ver 14.12 Distrib 5.0.77, for redhat-linux-gnu (x86_64) using readline 5.1
Connection id: 8
Current database: demodb
Current user: root@localhost
SSL: Not in use
Current pager: stdout
Using outfile: ''
Using delimiter: ;
Server version: 5.5.21 MySQL Community Server (GPL)
Protocol version: 10
Connection: Localhost via UNIX socket
Server characterset: latin1
Db characterset: utf8
Client characterset: latin1
Conn. characterset: latin1
UNIX socket: /var/lib/mysql/mysql.sock
Uptime: 33 sec
Threads: 7 Questions: 137 Slow queries: 0 Opens: 83 Flush tables: 1 Open tables: 76 Queries per second avg: 4.151
--------------
mysql>
启动方式: /etc/init.d/mysql.server start --character-set-server=utf8
效果:
mysql> use demodb;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> status;
--------------
mysql Ver 14.12 Distrib 5.0.77, for redhat-linux-gnu (x86_64) using readline 5.1
Connection id: 4
Current database: demodb
Current user: root@localhost
SSL: Not in use
Current pager: stdout
Using outfile: ''
Using delimiter: ;
Server version: 5.5.21 MySQL Community Server (GPL)
Protocol version: 10
Connection: Localhost via UNIX socket
Server characterset: utf8
Db characterset: utf8
Client characterset: latin1
Conn. characterset: latin1
相关新闻>>
最新推荐更多>>>
- 发表评论
-
- 最新评论 更多>>