mysql LOAD DATA INFILE with auto-increment primary key

后端 未结 5 1055
灰色年华
灰色年华 2021-02-19 03:48

I am trying to load a data file into mysql table using \"LOAD DATA LOCAL INFILE \'filename\' INTO TABLE \'tablename\'\".

The problem is the source data file contains dat

5条回答
  •  既然无缘
    2021-02-19 04:14

    the column list must be at the very end and id column must have a set=null to be auto incremented – unfortunately the mysql documentation is very vague. they justt say col1, col2, but are those in the source file or in the dest table . This page helped a lot by clear examples.

    http://www.experts-exchange.com/articles/Database/MySQL/Load-Delimited-Data-into-MySQL-Server.html

提交回复
热议问题