Add Auto-Increment ID to existing table? December 29, 2022 by Tarik Try this ALTER TABLE `users` ADD `id` INT NOT NULL AUTO_INCREMENT; for an existing primary key