I have an old database where I want to copy the entire row into a new table, but开发者_运维技巧 preserve the original id column (which is a primary/autoincrement field)
It seems to insert one row and then stop saying:
ERROR 1062 (23000): Duplicate entry '2' for key 'PRIMARY'
Am I missing some constraint issue/autoincrement not liking me explicitly choose the id #? Thanks for the help!
You are trying a row with ID of 2 when there is already a row in the table with an ID of 2. You can choose your own ID numbers as long as they're unique.
精彩评论