LOAD DATA LOCAL; How to skip the first line?

I am trying to upload a CSV file to my MySQL database, but I would skip the first line.

I am a fact. It contains the name of my columns and no interesting data.

Here is the query I'm using:

LOAD DATA LOCAL INFILE '/myfile.csv' INTO TABLE tableName FIELDS TERMINATED BY ',' ENCLOSED BY '\"' LINES TERMINATED BY '\n' (column,column,column); 
+53
sql import mysql csv load-data-infile
Oct 24 '09 at 15:59
source share
3 answers
 LOAD DATA INFILE '/tmp/test.txt' INTO TABLE test IGNORE 1 LINES; 

( link )

+92
Oct 24 '09 at 16:09
source share
β€” -

For the curious, IGNORE N LINES should be after the qualifier separators:

 LOAD DATA LOCAL INFILE '/myfile.csv' INTO TABLE tableName FIELDS TERMINATED BY ',' ENCLOSED BY '\"' LINES TERMINATED BY '\n' IGNORE 1 LINES (column,column,column); 
+19
Aug 02 '16 at 20:15
source share

IGNORE 1 LINES throws an error: SQL * Loader-350: Syntax error on line 7. Expected "(", found to "ignore".

How do I solve this?

0
Jan 30 '19 at 18:06
source share



All Articles