查看mysql数据库默认编码的方法

发布时间:2019-07-30编辑:脚本学堂
本文介绍了查看mysql数据库默认编码的方法,有需要的朋友参考下,希望对大家有所帮助。

查看mysql/ target=_blank class=infotextkey>mysql数据库的默认编码,有以下两种方法。

1、使用status命令显示数据库编码信息
 

复制代码 代码示例:
mysql> status;
————–
mysql ver 14.12 distrib 5.0.77, for win32 (ia32)
connection id:          1072
current database:
current user:           test@119.119.247.6
ssl:                    not in use
using delimiter:        ;
server version:         5.0.67-log mysql community server (gpl)
protocol version:       10
connection:             www.jb200.com via tcp/ip
server characterset:    gbk
db     characterset:    gbk
client characterset:    latin1
conn. characterset:    latin1
tcp port:               3306
uptime:                 15 days 2 hours 21 min 37 sec

2、使用show variables like命令显示数据库编码
 

复制代码 代码示例:
mysql> show variables like’char%’;
+————————–+——————————————–+
| variable_name            | value                                      |
+————————–+——————————————–+
| character_set_client     | latin1                                     |
| character_set_connection | latin1                                     |
| character_set_database | gbk                                        |
| character_set_filesystem | binary                                     |
| character_set_results    | latin1                                     |
| character_set_server     | gbk                                        |
| character_set_system     | utf8                                       |
| character_sets_dir       | /mysql/mastermysql50/share/mysql/charsets/ |
+————————–+——————————————–+
8 rows in set (0.03 sec)