开发者

MySQL copying over auto increment primary IDs

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜