How do I add auto_increment to an existing column of a MySQL table?
auto_increment
I think you want to MODIFY the column as described for the ALTER TABLE command. It might be something like this:
MODIFY
ALTER TABLE
ALTER TABLE users MODIFY id INTEGER NOT NULL AUTO_INCREMENT;
Before running above ensure that id column has a Primary index.
id
1.4m articles
1.4m replys
5 comments
57.0k users