sudo vi /etc/mysql/mysql.conf.d 选中mysqld.cnf按回车,在[mysqld]下面添加 character_set_server=utf8 sudo service mysql restart