phpmyadmin - Preserving character set when importing .CSV file to MySQL -


i want import .xlsx file ~60k rows mysql. columns contain vietnamese characters. managed convert .xlsx .csv without messing character set. can't same when importing .csv mysql.

i used load data infile. looks this:

load data local infile 'c:/projekt/big data/events.csv'  table database.table  fields terminated ','  enclosed '"'  lines terminated '\n'  ignore 1 lines; 

(source: http://blog.habrador.com/2013/01/how-to-import-large-csv-file-into-mysql.html)

this method imports data fine character set of vietnamese characters totally messed up. did change table's collation utf8_unicode_ci.

i test traditional import method of mysql smaller datasets , preserves font perfectly. cannot use since file's size exceeds limit of mysql.

really appreciate if me this.

try explicit character set specify import:

load data local infile 'c:/projekt/big data/events.csv'  table database.table  character set utf8 fields terminated ','  enclosed '"'  lines terminated '\n'  ignore 1 lines; 

see docs more details loading file.


Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -