View Full Version : Restart Auto_increment
techgearfree
02-13-2005, 07:36 PM
How do I restart a collumn with auto_increment. I want it to start counting up from 1 again.
hemebond
02-13-2005, 09:09 PM
Why do you want to do that?
techgearfree
02-13-2005, 09:43 PM
I was testing on my website how it makes users. When someone signs up. Their info goes into a table. I no longer need to test it, so I deleted all the users that I made. But, now when I make a user, in the user id column that is auto increment, the first user is like #42 (where I left off).
hemebond
02-13-2005, 09:55 PM
And why is this a problem?
(drop and recreate the table)
techgearfree
02-13-2005, 10:06 PM
Just for organizational sake. Is there any way to get the current code for the table so I don't have to type it all in again?
hemebond
02-13-2005, 10:17 PM
If you use phpMyAdmin you can do a quick export. Otherwise, dump the table and edit out the data.
andyede
02-14-2005, 12:43 AM
or just let it carry on counting from where it is. Is there any reason it needs to start at 1?
BigToque
02-14-2005, 07:19 AM
The way to do this (the easy way) is with phpMyAdmin.
When looking at the table structure, drop the auto-incrementing field, then recreate it. All entries will be renumbered starting from 1.
kenetix
02-15-2005, 02:06 PM
you could drop and reinsert the table and then populate it with the values. :)
Brandoe85
02-15-2005, 03:09 PM
You can try:
alter tableName auto_increment = 1;
Not tested though...:rolleyes:
vBulletin® v3.8.2, Copyright ©2000-2009, Jelsoft Enterprises Ltd.