I have a table, and I just want to remove all unique constraints on it.
I tried dropping the table and remaking it , but it won’t work. There is still constraint.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
see the MySQL documentation on ALTER TABLE
The question seems to be only about unique constraints on the table, i.e. a primary key. You can also use a similar syntax of ALTER TABLE to drop foreign key constraints (but you need to name the underlying field, for unlike primary key there may be several per table).
If you are interested in removing the field the primary key is based upon, ALTER TABLE to the rescue again, here with
... RROP COLUMN myColumnNameFinally, as you do all these changes, remember that some foreign key relations and/or the existence of some indexes may require that you drop “things” in an orderly fashion.