0%

MySQL设置默认编码为utf-8

To set the default to UTF-8, you want to add the following to 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

Works fine with MacOS Yosemite/MySQL 5.6.25

参考资料

http://stackoverflow.com/questions/3513773/change-mysql-default-character-set-to-utf-8-in-my-cnf