vim /etc/mysql/my.cnf 。(5.5以后系统)如下修改:
[client]
default-character-set=utf8
[mysqld]
default-storage-engine=INNODB
character-set-server=utf8
collation-server=utf8_general_ci
五、重启mysql(/etc/init.d/mysql stop /etc/init.d/mysql start)
六、修成成功,进入mysql查看字符集(mysql>show variables like ‘character_set_%’;)
时间: 2024-10-08 09:58:12