Thursday, 10 November 2011

Loading Data into MySql Tables

The following ststement can be used to load data from a text file into a MySql table.
LOAD DATA INFILE 'tmp/datafile.txt' INTO TABLE schema.table FIELDS TERMINATED BY '|' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\r\n' IGNORE 1 LINES;

No comments:

Post a Comment