Skip to content

Instantly share code, notes, and snippets.

@InvisibleKind
Last active April 1, 2016 16:54
Show Gist options
  • Save InvisibleKind/38922c66000da6a7a9bc40fc0866be4f to your computer and use it in GitHub Desktop.
Save InvisibleKind/38922c66000da6a7a9bc40fc0866be4f to your computer and use it in GitHub Desktop.
Drop all db tables
SET SESSION group_concat_max_len = 1000000;
SELECT GROUP_CONCAT(r1.query SEPARATOR "\n") AS copy_and_paste FROM (SELECT concat("DROP TABLE IF EXISTS ", table_name, ";") AS query FROM information_schema.tables WHERE table_schema = "my-db-name") AS r1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment