title: Running MySQL on RAMDisk
body: <p>I am in the process of speeding up a test suite that's using <code>MySQL</code> for persistence. I have changed the <code>datadir</code> and <code>tmpdir</code> in the <code>my.cnf</code> to use the RAMDisk as shown below.</p>
  
  <pre><code>datadir         = /run/shm/mysql
  tmpdir          = /run/shm/mysqltemp
  </code></pre>
  
  <p>The problem is that every time i run the entire test suite, at some point i ran into foreign key constraint violations when the tests try to delete certain rows as part of the functionality being tested. The weird part is that this does not happen when i do not run MySQL on RAMDisk or when i leave the <code>datadir</code> at the default <code>/var/lib/mysql/</code> but only change the <code>tmpdir</code>. I would like to run the tests with the <code>datadir</code> in RAM because i noticed that the clean up logic is blazingly fast when i do so.</p>
  
  <p>Could someone help point out what i might be doing wrong here?</p>