Reset a mysql table auto-increment to 1 in phpMyAdmin

Reset a mysql table auto-increment to 1 in phpMyAdmin 

ALTER TABLE tablename AUTO_INCREMENT = 1

How to set initial value and auto increment in MySQL?

Use this:

ALTER TABLE Tablename AUTO_INCREMENT=2001;

or if you haven't already added an id column, also add it

ALTER TABLE users ADD id INT UNSIGNED NOT NULL AUTO_INCREMENT,
    ADD INDEX (id);

No comments:

Post a Comment

how to call ssh from vs code

 To call SSH from VS Code, you can use the built-in Remote Development extension. This extension allows you to open a remote folder or works...