mysql 中文乱码
保证client,connection,database,results编码一致。
mysql> show variables like '%character%';
+--------------------------+---------------------------
------+
| Variable_name | Value
|
+--------------------------+---------------------------
------+
| character_set_client | gbk
|
| character_set_connection | gbk
|
| character_set_database | gbk
|
| character_set_filesystem | binary
|
| character_set_results | gbk
|
| character_set_server | gbk
|
| character_set_system | utf8
|
| character_sets_dir | D:\mysql-5.6.17-win32\mysq
sets\ |
在my.ini中设置默认编码格式
[mysqld]
character-set-server=gbk