打开mysql安装目录下的my.ini文件(我的是MySQL Server 5.5),修改如下:
default-character-set=utf8
character-set-server=utf8
设置成uft8之后控制台查询出的汉字是乱码,在控制台执行set character_set_results=gbk; 即可,但是这只是一个临时的设置,只对本窗口有效