I want to disallow some values to a field of a table. In my example table name is users and field is email. I have added CHECK constraint but I am still able to add these two email addresses to my table. Storage engine - InnoDB. I don't want to change this. I have run the following queries.
ALTER TABLE users
ADD CHECK (email NOT IN ("[email protected]", "[email protected]"));
or
ALTER TABLE users
ADD CONSTRAINT CHK_UserEmail CHECK (email NOT IN ("[email protected]", "[email protected]"));