Primary key already exists (Error 1883)

You have attempted to use the ADD PRIMARY KEY clause of the ALTER TABLE command on a table that already has a primary key.

Remove the existing primary key first.