Created
September 16, 2012 11:22
-
-
Save alchemycs/3732046 to your computer and use it in GitHub Desktop.
Create an SQL file that will drop all non-system databases
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
# Create an SQL file that will drop all non-system databases | |
mysql -u root -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);"}' > drop_all_databases.sql |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment