Set new number for autoincrement value in a MySQL table

drodero

Diego

Posted on March 31, 2023

Set new number for autoincrement value in a MySQL table

If you want to reset the auto-increment number of a table to start it again with a new value, you have to launch this SQL:

ALTER TABLE my_table_name AUTO_INCREMENT=400;
Enter fullscreen mode Exit fullscreen mode

In this case, 400 is the value you want to be the new start value.

💖 💪 🙅 🚩
drodero
Diego

Posted on March 31, 2023

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related