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
If you are running LOAD DATA LOCAL INFILE
from the windows shell, and you need to use OPTIONALLY ENCLOSED BY '"'
, you will have to do something like this in order to escape characters properly:
"C:\Program Files\MySQL\MySQL Server 5.6\bin\mysql" -u root --password=%password% -e "LOAD DATA LOCAL INFILE '!file!' INTO TABLE !table! FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"^""' LINES TERMINATED BY '\n' IGNORE 1 LINES" --verbose --show-warnings > mysql_!fname!.out