修改my.ini文件中的
[mysql]
default-character-set=gbk
[mysqld]
# The default character set that will be used when a new schema or table is
# created and no character set is definedcharacter-set-server=utf8
修改后,重启mysql。结果:
mysql> show variables like 'character_set%';
+--------------------------+-------------------------------------------+| Variable_name | Value |+--------------------------+-------------------------------------------+| character_set_client | gbk || character_set_connection | gbk || character_set_database | utf8 || character_set_filesystem | binary || character_set_results | gbk || character_set_server | utf8 || character_set_system | utf8 || character_sets_dir | D:\MySQL\MySQL Server 5.5\share\charsets\ |+--------------------------+-------------------------------------------+即使再次打开mysql还是这样的。