$ mysql --defaults-file=my.cnf -e 'show tables' | while read t; do mysql --defaults-file=my.cnt -e 'drop table '$t; done
If you have a root access to the database, a drop database + create database is easiest. This script is useful in situations where you don't have root access to the database.
First prepare a file
Make sure to protect this file with
The one-liner will execute
The above solution is lazy, because not all lines in the output of