MySQL Forums
Forum List  »  Newbie

Resetting Auto Increment?
Posted by: John Smith
Date: August 22, 2012 08:32PM

Alright, I'm very new to MySQL and I am using it in conjunction with PHP, which I am also rather inexperienced with. If I have a table where I delete rows, and an ID column with auto-increment, the incrementation simply continues as if nothing has happened. How can I make it fill in the blanks where there are holes?

For example, can I tell it to search from 1 on and insert any new rows starting at the minimum number missing? Or, even better can I reset all the current rows' ID's to just start at 1 and increment from there?

Is there any practical reason this would ever matter? How much would these types of processes slow down wait times on a web application?

Thanks in advance, any help is greatly appreciated!

Edited 1 time(s). Last edit at 08/22/2012 08:33PM by John Smith.

Options: ReplyQuote

Written By
Resetting Auto Increment?
August 22, 2012 08:32PM
August 22, 2012 09:37PM
August 22, 2012 09:51PM
August 25, 2012 10:49AM
August 25, 2012 01:36PM
August 27, 2012 08:24AM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.