mysql 自增主键重排

1 set @num = 0;
2 update projects set id = @num := @num +1;
3 alter table projects auto_increment = 1;
4 set @num = 0;
5 update nodes set id = @num := @num +1;
6 alter table nodes auto_increment = 1;

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注