Mysql重置主键id顺序

 消除因删除而产生错乱的主键id顺序

alter table  表名  drop column id;
alter table  表名  add id mediumint(8) not null primary key auto_increment first;

 

 

posted @ 2023-05-19 21:01  迁啊  阅读(56)  评论(0编辑  收藏  举报