Page 1 of 1

reset Auto Number

Posted: Wed Mar 24, 2004 8:33 pm
by Illusionist
Does anyoen know how to reset an Auto Increment feild back to 0, or 1 for a mysql table?? Because i'm, developing an app and filling the databse with bogus data for testing and i would liek to reset the Auto Increment field back t zero without having to recreate that field... I hope there is another way! Thanks

Posted: Wed Mar 24, 2004 8:36 pm
by markl999
TRUNCATE <tablename>

This will remove all the entries in the table and reset the auto inc column.

Posted: Wed Mar 24, 2004 8:56 pm
by Illusionist
cool! Thanks

Posted: Wed Mar 24, 2004 9:26 pm
by Steveo31
ALTER TABLE `tableName` AUTO_INCREMENT=0;