mysql set id auto increment
snippet in sql

mysql alter column auto increment

user465

ALTER TABLE document MODIFY COLUMN document_id INT auto_increment

mysql set id auto increment

user5207

ALTER TABLE users AUTO_INCREMENT=1001;

mysql reset auto increment id

user9457

SET  @num := 0;

UPDATE your_table SET id = @num := (@num+1);

ALTER TABLE your_table AUTO_INCREMENT =1;

mysql auto increment

user5674

AUTO INCREMENT Field
Auto-increment allows a unique number to be generated automatically when a new record is inserted into a table.

Often this is the primary key field that we would like to be created automatically every time a new record is inserted.

Syntax for MySQL
The following SQL statement defines the "Personid" column to be an auto-increment primary key field in the "Persons" table:

CREATE TABLE Persons (
    Personid int NOT NULL AUTO_INCREMENT,
    LastName varchar(255) NOT NULL,
    FirstName varchar(255),
    Age int,
    PRIMARY KEY (Personid)
);