make an ID in a mysql table auto_increment (after the fact)
For example, here’s a table that has a primary key but is not AUTO_INCREMENT: mysql> CREATE TABLE foo ( id INT NOT NULL, PRIMARY KEY (id) ); mysql> INSERT INTO foo VALUES (1), (2), (5); You can MODIFY the column to redefine it with the AUTO_INCREMENT option: mysql> ALTER TABLE foo MODIFY COLUMN id INT … Read more