Jump to content


Reset autoindex

  • Please log in to reply
2 replies to this topic

#1 freakus_maximus

  • Members
  • PipPipPip
  • Advanced Member
  • 177 posts

Posted 08 September 2006 - 05:04 PM

Is there a way to reset the autoindex?

Just curious, since with all my testing I go back and just wipe out the data in the tables and start clean but the next autoindex will not start at 1.

I tried removing the autoincrement after deleting the data, then make the id field autoincrement again, but that did not change anything, it still held the old next autoindex value.

#2 effigy

  • Staff Alumni
  • Advanced Member
  • 3,600 posts
  • LocationIL

Posted 08 September 2006 - 05:10 PM

I use TRUNCATE table_name in MySQL 5+. I think in the older versions it's DELETE FROM table_name as opposed to DELETE * FROM table_name.
Regexp | Unicode Article | Letter Database

#3 fenway

  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 08 September 2006 - 06:03 PM

DELETE will remove all records without re-setting the counter... TRUNCATE should work in all versions.
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users