MySQL Forums :: Backup :: Error 1062 while restoring backup
Error 1062 while restoring backup
Date: January 19, 2013 09:39PM
Sorry, I seen similar threads but I still couldn't find it addressing my issue plus, I needed some more info on this.
Requirement: To create an exact replica 'db4' of an existing DB 'db3'. This is a Request Tracker (RT) database that I'm trying to replicate on the same server.
MySQL version- 5.0.51a-24+lenny3 on Debian Lenny. Basically this is a test environment and but meets all the requirements for successful RT installation and functioning.
1. Shutdown webserver to prevent any access to database.
2. mysqldump -uuser -ppass db3 > db3.sql (size is 6G)
3. mysql -uuser -ppass db4 < db3.sql (db4 was a newly created blank database)
The 3rd step throws in the error:
ERROR 1062 (23000) at line 5524: Duplicate entry '600806' for key 1"
I ran the 2nd step again with --force. The restore completed but with 2 additional similar errors:
ERROR 1062 (23000) at line 6309: Duplicate entry '187694' for key 1
ERROR 1062 (23000) at line 6572: Duplicate entry '1567400' for key 1
Obviously the restored database reported missing records.
A "sed -n 5524p db3.sql" showed the "INSERT INTO `Attachments` VALUES ...' query.
Similarly for line numbers 6309 and 6572 "INSERT INTO ..." was reported for
tables 'Tickets' and 'Transactions'. The three tables are Innodb with all the
three having an 'id' column set as PRIMARY KEY with AUTO INCREMENT.
Does this indicate a corrupted/problematic db3 database?
How to proceed to create a 'consistent/working' replica (db4) of db3?
Edited 2 time(s). Last edit at 01/19/2013 09:44PM by Subin S.
Sorry, only registered users may post in this forum.
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.