/etc/mysql/my.cnf
/etc/init.d/mysql stop /etc/init.d/mysql start
[client] default-character-set = utf8 [mysqld] character-set-server = utf8 init_connect = 'SET NAMES utf8' [mysql] default-character-set = utf8
SHOW VARIABLES LIKE 'character_set_%';
在修改编码前就创建了表所以还是错的……