Anda dapat menjalankan kueri ini dan mendapatkan semua kueri sql yang perlu Anda jalankan;
select concat( 'drop table ', a.table_name, ';' )
from information_schema.tables a
where a.table_name like 'dynamic_%';
Anda dapat memasukkannya ke file seperti
INTO OUTFILE '/tmp/delete.sql';
perbarui menurut komentar alexandre
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;