首先还是要修改一下my.ini里面的client和server的编码,要改两处。。代码如下:
[client]
port=3306
[mysql]
default-character-set=utf8
# The TCP/IP Port the MySQL Server will listen on
port=3306
#Path to installation directory. All paths are usually resolved relative to this.
basedir="C:/Program Files/MySQL/MySQL Server 5.0/"
#Path to the database root
datadir="C:/Program Files/MySQL/MySQL Server 5.0/Data/"
# The default character set that will be used when a new schema or table is
# created and no character set is defined
default-character-set=utf8
如果这样还不行,说明该数据库的编码还是有问题,直接修改该数据的编码,代码如下:
alter database 数据库名 character set utf8;
这样基本上是可以搞定了。。只不过这个过程是不可逆的,大部分的备注还是可以显示成中文,少数的可能还是会乱码。