After deleting every row from a table with an auto_increment column, the auto_increment value remains the same, so each insert after that does not start on 1, but on whatever it left off. To reset it:
ALTER TABLE myTable AUTO_INCREMENT=0;
Obviously, using this method you can set it to any value you wish. If the table contains a row with that auto_increment value, it will set it to the next available one.
Recent Comments