修改/etc/my.cnf配置文件,在[mysqld]下添加编码配置,如下所示:[mysqld]character_set_server=utf8init_connect='SET NAMES utf8'重新启动mysql服务