Delete all tables in a MySQL database

I was looking for a script to delete all tables in a MySQL database without having to drop the database.

mysqldump -u [username] -p --add-drop-table [database] | grep ^DROP | mysql -u [username] -p

/cc @davelens

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Post Navigation