mysql LOAD DATA INFILE with auto-increment primary key

后端 未结 5 1076
灰色年华
灰色年华 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:18

    Specify a column list:

    By default, when no column list is provided at the end of the LOAD DATA INFILE statement, input lines are expected to contain a field for each table column. If you want to load only some of a table's columns, specify a column list:

    LOAD DATA INFILE 'persondata.txt' INTO TABLE persondata (col1,col2,...);

    http://dev.mysql.com/doc/refman/5.1/en/load-data.html

提交回复
热议问题