Add Auto-Increment ID to existing table?

Try this

ALTER TABLE `users` ADD `id` INT NOT NULL AUTO_INCREMENT;

for an existing primary key

Leave a Comment