Tules
Tules

Reputation: 4915

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

Upvotes: 3

Views: 8113

Answers (3)

N. Chamaa
N. Chamaa

Reputation: 1577

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

Upvotes: 0

msz
msz

Reputation: 31

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' 

Upvotes: 3

shantanuo
shantanuo

Reputation: 32296

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.

Upvotes: 3

Related Questions