MySQL错误1064 LOAD DATA LOCAL INFILE的语法不正确

时间:2019-03-05 17:46:51

标签: mysql

尝试加载csv文件。

我可以毫无问题地加载此查询:

LOAD DATA LOCAL INFILE 'C:/Users/ovoJa/Downloads/VEN01_527.csv'
INTO TABLE venom
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY '\r\n'
(status, appid, phone, year, firstname, lastname, address, make, model, city, state, zip, count);

如果我尝试向该语句添加IGNORE 1 ROWS以跳过标题行,则会出现语法错误。

LOAD DATA LOCAL INFILE 'C:/Users/ovoJa/Downloads/VEN01_527.csv'
INTO TABLE venom
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY '\r\n'
(status, appid, phone, year, firstname, lastname, address, make, model, city, state, zip, count)
IGNORE 1 ROWS;

1 个答案:

答案 0 :(得分:0)

IGNORE 1 ROWS必须排在列列表之前。 – Barmar(来源)