MYSQL import data from csv using LOAD DATA INFILE

前端 未结 11 1424
感动是毒
感动是毒 2020-11-22 09:12

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

11条回答
  •  感情败类
    2020-11-22 09:40

    You can try to insert like this :

    LOAD DATA INFILE '/tmp/filename.csv' replace INTO TABLE [table name] FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n' (field1,field2,field3);
    

提交回复
热议问题