Wednesday, December 5, 2007

MySQL import data from flat file

Type the following SQL at the mysql prompt:

LOAD DATA LOCAL INFILE '/importfile.csv' INTO TABLE test_table FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n' (field1, filed2, field3);

This is taken from How do I import delimited data to MySQL where more details can be found.

No comments: