Languages

MySQL - How to reset AUTO_INCREMENT?

0 points
Asked by:
Dirask Community
6810

How to reset AUTO_INCREMENT value to start counting from 1 again?

1 answer
0 points
Answered by:
Dirask Community
6810

Here's the solution I found:

ALTER TABLE `table_name` AUTO_INCREMENT = 1;

Note:

For InnoDB Engine the value of AUTO_INCREMENT is incremented by 1 and can't be overridden by AUTO_INCREMENT configuration settings.

0 comments Add comment
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join