Skip to content

Instantly share code, notes, and snippets.

@traedamatic
Created July 21, 2015 14:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save traedamatic/389200b473dabde4972b to your computer and use it in GitHub Desktop.
Save traedamatic/389200b473dabde4972b to your computer and use it in GitHub Desktop.
generate drop all tables sql
//@see http://stackoverflow.com/a/8248281
SET FOREIGN_KEY_CHECKS = 0
SELECT concat('DROP TABLE IF EXISTS ', table_name, ';') FROM information_schema.tables WHERE table_schema = 'MyDatabaseName';
SET FOREIGN_KEY_CHECKS = 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment