Skip to content

Instantly share code, notes, and snippets.

@yogin
Created November 20, 2012 18:41
Show Gist options
  • Save yogin/4120029 to your computer and use it in GitHub Desktop.
Save yogin/4120029 to your computer and use it in GitHub Desktop.
Generate SQL to DROP all databases
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