MySQL drop all tables from CLI

This is just as much for me as it is for you. Let's say you're setting up a server and the scripts for it don't clean up or fail nicely if tables already exist. Here's a quick way to drop all tables from the cli without workbench or any other tools

mysql -uroot -p<password> -e "show databases" | grep -v Database | grep -v mysql| grep -v information_schema| gawk '{print "drop database `" $1 "`;select sleep(0.1);"}' | mysql -uroot -p<password>

#mysql #cli #tip