MySQL重置ID起始值

方法一,執行SQL: truncate table test;  (這裏假定你的表名test) 這種方法好處是運行速度超快   方法二,執行以下SQL: (仍是假定表名是test) delete from test; alter table `test` auto_increment=1; 這種方法好處是能夠從任何值開始,缺點是若是數據量大的話delete from test;很是耗時數據庫 At
相關文章
相關標籤/搜索