I am importing some data of 20000 rows from a CSV file into Mysql.
Columns in the CSV are in a different order than MySQL table\'s columns. How to automatically assi
You probably need to set the FIELDS TERMINATED BY ',' or whatever the delimiter happens to be.
FIELDS TERMINATED BY ','
For a CSV file, your statement should look like this:
LOAD DATA INFILE 'data.csv' INTO TABLE tbl_name FIELDS TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY '\r\n' IGNORE 1 LINES;