Page 1 of 1
Reset autoincrement in mysql
Posted: Fri Aug 11, 2006 11:06 am
by olifile
Hi!!
I'm new user!
I have a problem in mysql. I dont know rest autoincrment in MYSQL.
Thank you for reply

Posted: Fri Aug 11, 2006 11:16 am
by feyd
Posted: Fri Aug 11, 2006 11:20 am
by Luke
ALTER TABLE `table` AUTO_INCREMENT =0
Posted: Fri Aug 11, 2006 11:21 am
by RobertGonzalez
Bear in mind that if you have data in your table and you reset the autoincremement pointer that you could run into all sorts of issues if that field is a primary key. I know from experience. It is a pain in the rear.
Posted: Fri Aug 11, 2006 11:39 am
by olifile
so simple
Solved
tk you!!

Posted: Fri Aug 11, 2006 11:55 am
by Christopher
I believe that:
TRUNCATE mytable;
Is the same as:
DELETE * FROM mytable;
ALTER TABLE `mytable` AUTO_INCREMENT =0;