Change auto-increment value
suggest changeAUTO_INCREMENT = n sets the next value the counter will generate. It does not renumber existing rows or fill gaps below the current maximum. If n is less than or equal to the largest value already stored, MySQL raises the counter to that maximum plus one.
After you delete the highest ids, set the counter to one more than the new maximum. If the largest remaining id is 100:
ALTER TABLE your_table_name AUTO_INCREMENT = 101;
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents