ALTER TABLE tablename AUTO_INCREMENT = value;
eg.
If I had a items table and I created a few new items and then deleted them, to set the auto increment value back to ‘100′ i would simply:
ALTER TABLE items AUTO_INCREMENT = 100;
ALTER TABLE tablename AUTO_INCREMENT = value;
ALTER TABLE items AUTO_INCREMENT = 100;
The SHOW ENGINE INNODB STATUS command in MySQL provides detailed information about the internal state of the InnoDB storage engine. This ...
3 comments:
Can you tell me how to reset the auto increment of all the tables in a database at a time
nice post, but no need to get the maximum values , it will set automatically you can get it from here
http://webobserve.blogspot.com/2011/02/reset-mysql-table-autoincrement.html
Thanks
Post a Comment