I have some data in a csv file and I want to insert it into a Mysql table. My question is how to do that in a way that no duplicate values inserted into the table. I have looked at the following reference http://dev.mysql.com/doc/refman/5.1/en/load-data.html and there is a keyword IGNORE but can’t see how to use it to insert unique values only.
I have some data in a csv file and I want to insert it
Share
Add unique index on the table using one or more columns:
You would use ignore to skip rows that error out due to duplicate index error.
Using load: