https://blog-en.openalfa.com/how-to-continue-after-an-error-execute-failed-duplicate-entry-in-mysql When an INSERT statement is executed to add a set of records to a table that has a unique key defined, it may happen that the value of the key in some of the records to be inserted is the same as that of records already in the table. The default behaviour in this case is that the execution fails with an error message “execute failed: Duplicate entry”. When this happens, no record is inserted, not even those whose keys do not clash with the keys of previously existing records. Example: Let’s say we are developing an application that needs a “customers” table, with columns “clientid”,”name” and “email”. There will be a unique key defined on the “clientid” field. We can create the table, and insert the first records successfully: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 mysql > create table customers ( clientid integer , nam...