DEV Community

Diego
Diego

Posted on

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.

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs