Adding Auto Increment to existing table

If you have a table that is already populated with data and has a column that contains a unique integer value that increases by 1 for each row in the table but does not have auto_increment turned on the following should help you convert that column to auto_increment.

First alter the the table to remove the PRIMARY KEY attribute from the column that you want to add auto increment to and whilst making the change also allow the column to contain NULL values.