1.进入mysql
show variables like "char%"
2.在/etc/mysql/my.cnf中增加以下内容
[client]
default-character-set=utf8
[mysql]
default-character-set=utf8
[mysqld]
collation-server = utf8_unicode_ci
init-connect='SET NAMES utf8'
character-set-server = utf8