Forum Moderators: open

Message Too Old, No Replies

Reset Auto Increment ID field

         

tonynoriega

3:55 pm on May 14, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



i have an auto increment "ID" field in mysql dbase...

i was doing some testing, and it obviously kept counting...

how can i reset it back to "1" so i can start fresh?

LifeinAsia

5:09 pm on May 14, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



One way is to delete the field and re-add it.

coopster

6:35 pm on May 14, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



If you don't need the data that is in the table you can TRUNCATE [dev.mysql.com] table.

tonynoriega

7:04 pm on May 14, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



i need to retain several records that are already in there....

am i just out of luck?

phranque

7:47 pm on May 14, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



assuming mysql:
SET insert_id = 1;