How to remove constraints from my MySQL table? How to remove constraints from my MySQL table? mysql mysql

How to remove constraints from my MySQL table?


Mysql has a special syntax for dropping foreign key constraints:

ALTER TABLE tbl_magazine_issue  DROP FOREIGN KEY FK_tbl_magazine_issue_mst_users


I had the same problem and I got to solve with this code:

ALTER TABLE `table_name` DROP FOREIGN KEY `id_name_fk`;ALTER TABLE `table_name` DROP INDEX  `id_name_fk`;


There is no such thing as DROP CONSTRAINT in MySQL. In your case you could use DROP FOREIGN KEY instead.