Restoring a backup that has UNIQUE index violations in it
Posted by:
Tim Nope
Date: May 13, 2014 09:31AM
Hello,
I need to restore a MySQL database from a SQL-File. (The file, db_backup.sql, was created by PhpMyAdmin). I use the following command to restore the file:
mysql -u root -pMySecretPwd dbname < db_backup.sql
After some time, I get the following error message:
ERROR 1062 (23000) at line 604815: Duplicate entry 'Aircon' for key
'busfeatures_name_UNIQUE'
So I guess some data in the backup violates the unique constraint (most likely because it was inserted before the constraint was in place).
What is the best practice to restore the backup?
Thanks in advance,
Tim
Subject
Views
Written By
Posted
Restoring a backup that has UNIQUE index violations in it
2308
May 13, 2014 09:31AM
1251
May 18, 2014 10:04AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.