Try this
ALTER TABLE `users` ADD `id` INT NOT NULL AUTO_INCREMENT;
for an existing primary key
More Related Contents:
- How to reset AUTO_INCREMENT in MySQL
- SQL: Creating a Relational table with 2 different auto_increment
- How to insert data to MySQL with auto-incremented column(field)?
- INSERT INTO SELECT statement with more columns which is not in another table
- MySQL how to fill missing dates in range?
- Left Outer Join doesn’t return all rows from my left table?
- ‘IF’ in ‘SELECT’ statement – choose output value based on column values
- How to split the name string in mysql?
- Can a foreign key reference a non-unique index?
- Why does MySQL allow “group by” queries WITHOUT aggregate functions?
- How to set a maximum execution time for a mysql query?
- Get the latest date from grouped MySQL data
- SQL keys, MUL vs PRI vs UNI
- Cast int to varchar
- Import SQL file into mysql
- MySQL SELECT last few days?
- “where 1=1” statement [duplicate]
- Split a string and loop through values in MySQL stored procedure
- how to cast the hexadecimal to varchar(datetime)?
- MySQL Select Query – Get only first 10 characters of a value
- How to get a list of months between two dates in mysql
- My SQL Dynamic query execute and get ouput into a variable in stored procedure
- Postgres LEFT JOIN with WHERE condition
- How to check if field is null or empty in MySQL?
- mysql select id and name from other table and join query
- SQL (MySQL) vs NoSQL (CouchDB) [closed]
- DELETE FROM `table` AS `alias` … WHERE `alias`.`column` … why syntax error?
- MySQL update statement to store ranking positions
- How to convert a varchar column type to date type without losing the dates
- MySQL Multiple Joins in one query?