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'.
- mysqldump -uuser -ppass db3 > db3.sql (size is 6G)
- mysql -uuser -ppass db4 < db3.sql (db4 was a newly created blank database)
The 2nd 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
On completion when I queried certain tables of db4 database, I was able to see missing records.
Does this indicate a corrupted/problematic db3 database?
How to proceed to create a 'consistent/working' replica (db4) of db3?
If (2) fails, how to possibly troubleshoot and find the reason behind why it occurs?