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;

 

posted @ 2015-11-02 00:57  刘满blog  阅读(628)  评论(0编辑  收藏  举报