Today, between the two MySQL servers to guide the data, because another MySQL server is testing, one months of data, from the existing MySQL server Select to a file, the specific statement is:
* FROM news where Ine_time>=<"/tmp/newsdata.sql";
Then SCP to another MySQL online poker room server to import into the corresponding table, the specific statement is as follows:
"/home/lsanotes/newsdata.sql" into table news;
And then refresh the Web page to access this database, found that the first one months of data are garbled, and the other months before the normal, with show create TABLE news, see found two servers in the news table is UTF8, strange, to convert the exported data into UTF8, The problem of re-importing is still.
Later in the database to view the one months of data that just entered, did not execute set names UTF8; you can normally view Chinese without garbled, and other months must first execute set names UTF8; to see Chinese without garbled, but when I executed set names UTF8; And then see just the one months of data is garbled, it seems that the data is not UTF8 format. The Final Solution is:
"/home/lsanotes/newsdata.sql" into table news character set UTF8;
The last Web page appears normal.
Http://www.lsanotes.cn/load-data-local-infile
MySQL uses load data local infile to import part of the data after the Chinese garbled