http://www.ynpxrz.com/n773257c2024.aspx
从shell进入mysql,
mysql> show variables like ‘%char%';
+--------------------------+---------------+
| Variable_name | Value |
+--------------------------+---------------+
| character_set_client | gbk |
| character_set_connection | gbk |
| character_set_database | utf8 |
| character_set_filesystem | binary |
| character_set_results | gbk |
| character_set_server | utf8 |
| character_set_system | utf8 |
+--------------------------+-------------+
看上图中那几个编码不是 utf8,然后一个一个设置成utf8即可:
mysql>set character_set_database=utf8; ##设置默认的字符集为utf8
但是注意, character_set_filesystem | binary | 这个不用设置为utf8