We have a CSV file with thousands of records in it. I want to import these rows into a MySQL table via phpmyadmin. here is the command used:
load data loca
You say that the ID field has the AUTO_INCREMENT
attribute, but there's no mention of it in the CREATE TABLE
statement. This is part of the problem.
The other part is those truncation warnings. Some of the rows in the CSV file probably contain data that is too long to fit inside the columns. Increase the size of those text columns to a bigger value (let's say 200) and try again.
Are you absolutely sure that the CSV file is valid ? (a.k.a. each row has the same number of values etc.). You should probably check if those strings contain commas (,
), although that shouldn't be an issue.