开发者

CSV utf8 import with phpmyadmin

I am trying to import a dataset with korean characters in, saved as unicode encoding using CSV LOAD DATA

even when I set the input character set to utf8 the korean get's mang开发者_JAVA百科led

the encoding for that column is of course utf8

sample record (tab delimited):

79  읽다  read    NULL

what goes into MYSQL:

79  ì½ë‹¤   read    NULL


load data supports character set clause

load data local infile 'filename.txt' into table test.unicode CHARACTER SET utf8

Use it from the command line if phpmyadmin ignores it.


It seems like phpmyadmin ignores the select drop-down, and does not append the CHARACTER SET utf8 clause to the query.

You can manually execute the query that phpMyAdmin should, however. Try this:

LOAD DATA LOCAL INFILE 'e:\\www\\wro11.csv' INTO TABLE `videos` CHARACTER SET utf8 FIELDS TERMINATED BY ';' ENCLOSED BY '"' ESCAPED BY '\\' LINES TERMINATED BY '\n' 


here is an example: LOAD DATA INFILE 'data.txt' INTO TABLE tbl_name FIELDS TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY '\r\n' IGNORE 1 LINES;

http://dev.mysql.com/doc/refman/5.0/en/load-data.html

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜