MySQL中“转储SQL文件”生成的文件中中文字符乱码,查看数据库属性如下图:

解决方案:
直接进入:C:\Program Files\MySQL\MySQL Server 5.1路径下,修改my.ini文件,如下:
... ... ... ...
#Path to installation directory. All paths are usually resolved relative to this.
basedir="C:/Program Files/MySQL/MySQL Server 5.1/"
#Path to the database root
datadir="C:/ProgramData/MySQL/MySQL Server 5.1/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
# The default storage engine that will be used when create new tables when
default-storage-engine=INNODB
本文介绍了如何解决MySQL导出的SQL文件中出现中文乱码的情况。通过修改my.ini文件中的default-character-set参数为utf8,可以确保新建的数据库及表使用正确的字符集,从而避免乱码问题。
543

被折叠的 条评论
为什么被折叠?



