First you need to drop the key. I do not know the names of your tables, but I will give you a general strategy using an example. Suppose you have the following 2 InnoDB tables:
CREATE TABLE `A` (
`id` int(10) unsigned NOT NULL auto_increment,
PRIMARY KEY (`id`)
) ENGINE=InnoDB;
CREATE TABLE `B` (
`id` int(10) unsigned NOT NULL auto_increment,
`a_id` int(10) unsigned NOT NULL,
PRIMARY KEY (`id`),
KEY `a_id` (`a_id`),
CONSTRAINT `b_ibfk_1` FOREIGN KEY (`a_id`) REFERENCES `a` (`id`)
) ENGINE=InnoDB;
You can leave the column a_idin the table Busing the following command:
alter table B drop foreign key b_ibfk_1, drop column a_id;
source
share