[mysqld] datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock # Default to using old password format for compatibility with mysql 3.x # clients (those using the mysqlclient10 compatibility package). old_passwords=1 ← 找到这一行,在这一行的下面添加新的规则,让MySQL的默认编码为UTF-8 default-character-set = utf8 ← 添加这一行 然后在配置文件的文尾填加如下语句: [mysql] default-character-set = utf8