/etc/my.cnf默認(rèn)是沒有,可以自從/usr/local/mysql/support-files copy一份到etc。
命令 cp /usr/local/mysql/support-files/my-default.cnf /etc/my.cnf
然后再my.cnf中添加
[client]
default-character-set=utf8
[mysqld]
character-set-server=utf8
重啟數(shù)據(jù)庫。賬號(hào)登錄后,輸入命令:show variables like '%char%';