title: mysql delete and foreign key constraint
body: <p>I'm deleting selected rows from both table in MYSQL, the two tables have foreign keys.</p>
  
  <pre><code>DELETE d,b
    FROM A as b
    INNER JOIN B as d on b.bid=d.bid WHERE b.name LIKE '%xxxx%';
  </code></pre>
  
  <p>MYSQL complains about foreign keys even though I'm trying to delete from both tables:</p>
  
  <pre><code>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)
  </code></pre>
  
  <p>what's the best solution here to delete from both table?</p>