Mysql重置主键id顺序

迁啊 / 2023-05-19 / 原文

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

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