0

询问:load data infile 'systemmessage.txt' ignore into table systemmessage (message) lines starting by 'a,' terminated by '\0' ignore 1 lines

在“开始的行”附近给我一个语法错误。如果我删除“开始于”部分,则错误现在是“终止于”。如果我也将其删除,则错误是“忽略 1 行”。到底哪里有问题??文件存在,表存在,如果我删除它加载的所有检查,但数据错误。

4

1 回答 1

1

您只需要将列列表移动到 SQL 语句的末尾。

如手册中所述,需要在(可选)列列表之前指定格式信息(以开头的行、跳过 1 行等):

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

这是固定查询:

load data infile '/tmp/systemmessage.txt' 
ignore into table systemmessage 
lines starting by 'a,' 
terminated by '\0' 
ignore 1 lines
(message)
于 2010-11-16T19:48:51.757 回答