 <p>you can run this query and get all the sql queries that you need to run; </p> <pre><code>select concat( 'drop table ', a.table_name, ';' ) from information_schema.tables a where a.table_name like 'dynamic_%'; </code></pre> <p>you can insert it to file like</p> <pre><code>INTO OUTFILE '/tmp/delete.sql'; </code></pre> <h1>update according to alexandre comment</h1> <pre><code>SET @v = ( select concat( 'drop table ', group_concat(a.table_name)) from information_schema.tables a where a.table_name like 'dynamic_%' AND a.table_schema = DATABASE() ;); PREPARE s FROM @v; EXECUTE s; </code></pre>