One thought on “How do I go about resetting the AUTO_INCREMENT count in MySQL?

  1. Hello James

    In order to reset the counter you need to run the following script:

    ALTER TABLE tablename AUTO_INCREMENT = 1

    There are however some conditions:
    For MyISAM, if the value is less than or equal to the maximum value currently in the AUTO_INCREMENT column, the value is reset to the current maximum plus one. For InnoDB, if the value is less than the current maximum value in the column, no error occurs and the current sequence value is not changed.

Comments are closed.