show variables like'character_set_%';查看 如下:
1 mysql> SHOW VARIABLES LIKE 'character_set_%';
2 +--------------------------+-----------------------------------------+
3 | Variable_name Value |
4 +--------------------------+-----------------------------------------+
5 | character_set_client latin1 |
6 character_set_connection latin1 |
7 | character_set_database latin1 |
8 | character_set_filesystem binary |
9 | character_set_results latin1 |
10 | character_set_server latin1 |
11 | character_set_system utf8 |
12 | character_sets_dir | E:/usr/MySQL Server /share/charsets/ |
13 +--------------------------+-----------------------------------------+
14 8 rows in set (0.00 sec)
只有character_set_system 为utf8.
二。修改my.ini里的[my sql]
default-character-set=latin1
[my sqld]
……
……
default-character-set=latin1
为utf8后,在查看编码:又有两个的编码方式变成了 utf8
character_set_database和character_set_server的编码方式变成了utf8
三。执行命令 set names 'utf8'
结果,所有的编码方式都一致了。
本文转自xyz_lmn51CTO博客,原文链接:http://blog.51cto.com/xyzlmn/819967,如需转载请自行联系原作者