Created
November 20, 2012 18:41
-
-
Save yogin/4120029 to your computer and use it in GitHub Desktop.
Generate SQL to DROP all 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
pager sed 's/,/ /g' | |
SELECT GROUP_CONCAT(CONCAT('DROP DATABASE ',SCHEMA_NAME,';')) FROM information_schema.schemata WHERE schema_name NOT IN ('mysql', 'information_schema'); | |
nopager |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment