Skip to content

Instantly share code, notes, and snippets.

@JulienBreux
Created January 11, 2013 14:00
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 JulienBreux/4510862 to your computer and use it in GitHub Desktop.
Save JulienBreux/4510862 to your computer and use it in GitHub Desktop.
TRUNCATE / DROP tables DATABASE
TRUNCATE
mysql -Nse 'show tables' DATABASE_NAME | while read table; do mysql -e "truncate table $table" DATABASE_NAME; done
DROP
mysql -Nse 'show tables' DATABASE_NAME | while read table; do mysql -e "drop table $table" DATABASE_NAME; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment