首先/etc下面my.cnf文件中加入
[client]下面加
default-character-set=utf8
[mysqld]下面加
到mysql控制台修改已经有的项目的字符集:
alter database [dbname] character set uft8;