2012-03-29 65 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. 
相關問題