Oct 6 2009

A quick tip – you can import a CSV into a MySQL table pretty easily. The file must exist on the server and you must create the table first, but this command will import your CSV into a MySQL table easily:

LOAD DATA LOCAL INFILE '/tmp/data.csv'
INTO TABLE `data_table`
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY '\n';

Leave a Reply