Stop MySQL Reusing AUTO_INCREMENT IDs

后端 未结 5 1650
闹比i
闹比i 2020-12-07 01:40

I have a table with an AUTO_INCREMENT primary key. If the last row in the table is deleted, the next-inserted row will take the same ID.

Is there a way of getting My

5条回答
  •  庸人自扰
    2020-12-07 01:55

    As of MySQL version 8, MySQL no longer re-uses AUTO_INCREMENT ID values, fixing the long-standing (opened in 2003!!) bug #199.

    For more info, see this blog post by MySQL Community Manager lefred: https://lefred.be/content/bye-bye-bug-199/

提交回复
热议问题