I need to drop a deprecated, empty table from my MySQL Database.
The table definition is noddy:
CREATE TABLE IF NOT EXISTS `Address` (
`Id` int(11) NOT NULL AUTO_INCREMENT,
`ContactId` int(11) NOT NULL,
PRIMARY KEY (`Id`),
KEY `ContactId` (`ContactId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
This results in
#1217 - Cannot delete or update a parent row: a foreign key constraint fails
There was a constraint on ContactId but II’ve removed it.
PHPMyAdmin’s export function doesn’t show anything beyond the table definition shown above. There are no rows in the table and, to my knowledge, no FKs reference the Address.Id field (But I don’t know how to verify this).
Can someone please advise how I can get rid of the table?
To list foreign keys
For specifc search in your case:
To drop a foreign key constraint: