mysqlmysql-error-1062

How to restore data from MYSQL dump without any duplicate key errors?


Everytime I try restoring the dump, I get :

ERROR 1062 (23000) at line 10297: Duplicate entry 'spaß' for key 'PRIMARY'

I am trying to restore it using:

mysql -u root -ppassword database < 0719.sql

Solution

  • You could import the dump into a temporary table, than use an SQL statement to copy only rows from this temporary table which do are not found in the target table.