>To alter 1 column to a unique key,
>
>ALTER TABLE user MODIFY COLUMN id INT NOT NULL UNIQUE;
>
>But how to set combination of 2 columns as a unique key?
>Individual keys are not unique, but combination is.
ALTER TABLE user ADD UNIQUE (id,domain);
That just adds an index. You might need to drop an old one first. Or not.