Remove all tables in a database

One liner to remove all tables in a database

 

mysql -u uname dbname -e “show tables” | grep -v Tables_in | grep -v “+” | gawk ‘{print “drop table ” $1 “;”}’ | mysql -u uname dbname

Advertisements