Reorder / reset auto increment primary key

后端 未结 15 1595
北荒
北荒 2020-11-22 04:39

I have a MySQL table with an auto increment primary key. I deleted some rows in the middle of the table. Now I have, for example, something like this in the ID column: 12, 1

15条回答
  •  野趣味
    野趣味 (楼主)
    2020-11-22 05:28

    in phpmyadmin

    note: this will work if you delete last rows not middle rows.

    goto your table-> click on operations menu-> goto table options->change AUTO_INCREMENT to that no from where you want to start.

    your table autoincrement start from that no.

    try it.

提交回复
热议问题