Assuming you don't have a key in the table, you can do this:
ALTER TABLE whatever ADD id Int NOT NULL AUTO_INCREMENT PRIMARY KEY;
And remember that you can add FIRST at the end of this row to make it the first column, which would be a good idea for id.
source share