Created
September 2, 2016 08:38
-
-
Save rubiread/4ff92f5d5cf4e994f43eb5ece6ec723e to your computer and use it in GitHub Desktop.
Delete all databases from mysql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mysql -uroot -p -e "show databases" | grep -v Database | grep -v mysql| grep -v information_schema| grep -v test | grep -v OLD |gawk '{print "drop database " $1 ";select sleep(0.1);"}' | mysql -uroot -ppassword |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment