0
我正试图使用LOAD DATA LOCAL INFILE将数据从CSV导入到MySQL。对于所谓的 “数” 有我收到错误1366不正确的整数值的所有空值的整数列:1366不正确的整数值:将数据从CSV导入到mysql时出错
我已经试过count = IF(@count='',NULL,@count)
CREATE TABLE MySchema.response:
CREATE TABLE MySchema.response
(
`id` int,
`name` varchar(500),
`count` int,
);
将数据加载到表:
LOAD DATA LOCAL INFILE 'C:/response.csv'
INTO TABLE MySchema.response
FIELDS TERMINATED BY ',' optionally ENCLOSED by '"'
ignore 1 lines
(id, name, @count)
SET count = IF(@count='',NULL,@count)
样本CSV文件数据
1,abc,
2,xyz,
我遇到了同样的问题,现在。你有没有设法解决这个问题? –