Drop All Tables in MySQL Database in one single command

Usually to to drop the database / schema and then re-create it is a quite easy way to delete all the tables. But this is applicable only if you have the permission to deal with the database / schema

A little trick I learned today:

mysqldump -u usr -ppwd -h host -P port --add-drop-table --no-data schema_name | grep ^DROP | mysql -u usr -ppwd -h host -P port schema

Leave a Reply

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

*