#修改后的效果如下:
[client]
port=3306
default-character-set=utf8
[mysql]
default-character-set=utf8
set character_set_database=utf8;
set character_set_server=utf8;
set character_set_client=utf8;
set character_set_connection=gbk;
set character_set_results=gbk;修改好以后通过cmd登陆mysql :mysql -u root -p查看编码格式:show variables like "%char%";如下图就没得问题了。