No no...it's easy!
Just do this:
ALTER TABLE tablename ADD uniqueid INT AUTO_INCREMENT PRIMARY KEY;
And that will not only add the field, make it a primary key, but it will also RIGHT THEN AND THERE populate *ALL* the existing records with the field!
(If you want to, after removing the duplicates you could then remove the column, but I wouldn't bother.)