解决autoincrement的重置问题

(DELETE)删除表数据之后,auto_increment不会变成初始值,要重置的方式有两种:

1、truncate tbname ;
直接清空所有数据,并将auto_increment重置为0。

 

2、alter table tbname auto_increment = x  ;
设置表tbname的唯一auto_increment字段起始值从x开始。

posted @ 2014-11-05 15:29  Craze_lee  阅读(818)  评论(0编辑  收藏  举报