mysql delete and foreign key constraint
- by user121196
I'm deleting selected rows from both table in MYSQL, the two tables have foreign keys.
delete d,b from A as b inner join B as d on b.bid=d.bid where b.name like '%xxxx%';
MYSQL complains about foreign keys even though I'm trying to delete from both tables:
Error: Cannot delete or update a parent row: a foreign key constraint fails (yyy/d, CONSTRAINT fk_d_bid FOREIGN KEY (bid) REFERENCES b (bid) ON DELETE NO ACTION ON UPDATE NO ACTION)
what's the best solution here to delete from both table?