嗨,这是我的负载声明:
load data local infile 'C:/GeoIPCountryWhois.csv' into table geolocation fields terminated by ','
enclosed by '"'
lines terminated by '\n';
30 row(s) affected, 1 warning(s):
1265 Data truncated for column 'cn' at row 30
Records: 30 Deleted: 0 Skipped: 0 Warnings: 1
CREATE TABLE `geolocation` (
`start_ip` char(15) NOT NULL,
`end_ip` char(15) NOT NULL,
`start` int(10) unsigned NOT NULL,
`end` int(10) unsigned NOT NULL,
`cc` char(2) NOT NULL,
`cn` varchar(50) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8
我发现问题很可能是下面的行,因为韩国的逗号是一个新领域的开始。
1.11.0.0,1.11.255.255,17498112,17563647,KR,“韩国,共和国”
我可以删除所有逗号,但我可以以某种方式更改加载语句吗?