title: How do I delete all rows from all tables in a database from MySQL?
body: <p>I have a database in my mysql.  Inside are tables with each name an email address.  Each table has the same structure.  So something like </p>
  
  <pre><code>data (database)
      x@x.com (table name)
          [column 1] [column 2] ... (column names)
  </code></pre>
  
  <p>I'd like to create an event that removes entries after 24 hours.  Unfortunately I'm unable to do something like</p>
  
  <pre><code>DELETE FROM data.* WHERE created &lt; DATE_SUB(NOW(), INTERVAL 1 DAY)
  </code></pre>
  
  <p>It looks like I'm unable to use the wildcard.  What's the easiest way to accomplish this?</p>
  
  <p>Edit:</p>
  
  <p>Truncating all tables is not the proper solution I'm looking for as I'm not looking to purge all data in a table, but rather select data based on a condition.   </p>
  
  <p>I found the easiest solution would be to just write a script like Nick mentioned to select the data I need from information_schema and delete the entries I need from each table based on the condition I need.</p>