views:

431

answers:

1

Hi,

I'm trying to import about 10K rows of UTF-8 encoded data into a new MySQL table.

I can do so successfully with LOAD DATA INFILE via MySQL Workbench but it the UTF-8 characters get mangled. I've tested the database otherwise via PHP and it accepts stores UTF-8 charaters fine. The problem seems to be with LOAD DATA INFILE, and I've come across a few threads about this.

Does anyone know a workaround, or possibly another similarly easy method to import CSV data?

Thank you.

RESOLVED:

For others who see this and have the same problem, just add character set as a parameter when running LOAD DATA INFILE. Simpler than I realised :)

+2  A: 

According to MySQL documentation for LOAD DATA, you can specify a CHARACTER SET parameter in your statement to provide the input file character set.

Have you tried providing 'utf8' as the input character set?

Miguel Ventura
Thanks..... just found the same solution, ran the data in and it works!
Tom