简体   繁体   中英

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 mangled

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM