CSV utf8 import with phpmyadmin

女生的网名这么多〃 提交于 2020-01-04 04:08:29

问题


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

回答1:


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.




回答2:


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' 



回答3:


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



来源:https://stackoverflow.com/questions/4539996/csv-utf8-import-with-phpmyadmin

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!