[ale] Auto increment in MySQL

George Carless kafka at antichri.st
Wed Sep 14 21:34:03 EDT 2005


On Wed, Sep 14, 2005 at 09:27:55PM -0400, James Sumners wrote:
> I believe you will have to drop the table and re-create it.
> 
> On 9/14/05, Christopher Fowler <cfowler at outpostsentinel.com> wrote:
> > Can anyone tell me how to reset an autoincrement on a table in MySQL.
> > The docs tell me that it is set to max(id) on startup.  If I delete
> > everything from the table and then restart the server it is as if
> > the max(id) no longer reads 0.  It still reads the old value but there
> > is nothing in the table.

You do not have to drop/recreate the table.  Google (as usual) would've 
provided the answer:

ALTER TABLE theTableInQuestion AUTO_INCREMENT=1234

--George



More information about the Ale mailing list