title: Force drop mysql bypassing foreign key constraint
body: <p>I'm trying to delete all tables from a database except one, and I end up having the following error:</p>
  
  <blockquote>
    <p>Cannot delete or update a parent row: a foreign key constraint fails </p>
  </blockquote>
  
  <p>Of course I could trial and error to see what those key constraints are and eventually delete all tables but I'd like to know if there is a fast way to force drop all tables (as I'll be able to re-insert those I don't want deleted).</p>
  
  <p>Google aimed me at some site that suggested the following method:</p>
  
  <pre><code>mysql&gt; SET foreign_key_checks = 0;
  mysql&gt; drop table ...
  mysql&gt; SET foreign_key_checks = 1;
  </code></pre>
  
  <p>Short answer is it didn't really do the trick since I ended up receiving the same error while I was able to delete some more tables. I've seen on Stack Overflow ways to get all foreign keys linked to a certain table but that's way too time consuming unless I script it all (which is doable in the case there is no other option)</p>
  
  <p>Database is 4.1 so I can't use <code>DROP DATABASE</code></p>
  
  <p>Ideas?</p>