首页 > php mysql > 查看mysql编码和版本

查看mysql编码和版本

2010年2月2日

mysql> show Variables like ‘%set%’;
+————————–+————————————+
| Variable_name            | Value                              |
+————————–+————————————+
| auto_increment_offset    | 1                                  |
| character_set_client     | latin1                             |
| character_set_connection | latin1                             |
| character_set_database   | latin1                             |
| character_set_filesystem | binary                             |
| character_set_results    | latin1                             |
| character_set_server     | latin1                             |
| character_set_system     | utf8                               |
| character_sets_dir       | /data/mysql5/share/mysql/charsets/ |
+————————–+————————————+
9 rows in set (0.00 sec)

mysql> \s

————–

./mysql Ver 14.12 Distrib 5.0.22, for pc-linux-gnu (i686) using EditLine wrapper

Connection id:          145

Current database:

Current user:           root@localhost

SSL:                    Not in use

Current pager:          stdout

Using outfile:          ”

Using delimiter:        ;

Server version:         5.0.22-log

Protocol version:       10

Connection:             Localhost via UNIX socket

Server characterset:    latin1

Db     characterset:    latin1

Client characterset:    latin1

Conn. characterset:    latin1

UNIX socket:            /tmp/mysql.sock

Uptime:                 2 days 20 hours 48 min 32 sec

Threads: 2 Questions: 728 Slow queries: 0 Opens: 0 Flush tables: 2 Open tables: 66 Queries per second avg: 0.003

————–

设置编码

SET NAMES utf8;

php mysql 浏览853 次

本文的评论功能被关闭了.