i'm trying to import a csv file into MySQL under CentOS.
The csv file comes from a conversion of excel under Windows. Here it is:
1,Colombo
Then I create a table with the command:
create table testcity2 (id Integer, name_eng varchar(100), primary key(id)) ENGINE=InnoDB DEFAULT CHARACTER SET=utf8;
After that I try to import it:
LOAD DATA LOCAL INFILE '~/citytmp.csv' INTO TABLE testcity2 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
For now everything seems fine.
However, when I try to import csv file containing multiple lines, everything is mess up. I mean when I select * from testcity2
, I get messy codes.
Here is the warning that I get:
Warning | 1366 | Incorrect integer value: '1' for column 'id' at row 1