2015-08-25

MySQL - How to load a data text file into a table

LOAD DATA LOCAL INFILE "file_name_here.csv" INTO TABLE table_name_here FIELDS TERMINATED BY ',' ENCLOSED BY '"' LINES STARTING BY 'xxx' LINES TERMINATED BY '\r\n' IGNORE 0 LINES


PS. Most arguments are optional (e.g. lines starting by... to be used only if each line starts with a given string).

No comments:

Post a Comment