2012-03-29 64 views

回答

1

你的情况主要的问题是,当你更改排序规则/字符从表的表里面的数据是latin1的并表是UTF8,直到然后设置。

什么你可以尝试是使表的转储与旧字符集。

mysqldump -uuser -p --default-character-set=latin1 dbname > dump.sql 

,然后用新的字符集,这样导入数据库:

mysql -uuser -p --default-character-set=utf8 dbname_test < dump.sql 

为了测试我将转储导入到测试数据库。如果导入后字符不正确。使用像pspadnotepad++或一个编辑器和更改文件编码UTF-8。在此之后,您可以尝试导入另一次。

次数最多的编码是很烦人的,但我希望你能解决这个问题。

当你只有phpMyAdmin的使用“导出”功能,使同样的与phpMyAdmin。以实际编码导出并尝试导入新编码,但是必须更改我认为的文件编码。

1

更改缺省归类在MySQL中utf8_general_ci:

Open the my.ini file. (C:\xampp\mysql\bin\my.ini) 
Find the text [mysqld] and add the below lines. 

的[mysqld]

字符集服务器= UTF8

核对服务器= utf8_general_ci

The above two lines will select a character set and collation at server startup. These settings apply server-wide and apply as the defaults for databases created by any application, and for tables created in those databases. 
相关问题