MySQL Forums
Forum List  »  Backup

Re: Mysterious duplicate entry error for key from MySQL Backup
Posted by: Bill Swartz
Date: August 24, 2012 09:33AM

This may be out of context for Error #1062 occurring in a backup/restore, but there is another cause similar to the trigger cause mentioned earlier in this thread. If you are inserting into a table WITHOUT an auto-incremented primary key from a select (i.e. "INSERT table SELECT 1, ..."), if the select returns multiple rows the insert will fail with Err 1062 since the statement is trying to insert more than one identical primary key value ("1" in the parenthetical sample above). Hence the error text, "duplicate entry '1' for key 1".

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Mysterious duplicate entry error for key from MySQL Backup
2351
August 24, 2012 09:33AM


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.