Skip to content

Instantly share code, notes, and snippets.

@arispublic
Created June 19, 2015 05:43
Show Gist options
  • Save arispublic/164eff0dfabbb77a5ff4 to your computer and use it in GitHub Desktop.
Save arispublic/164eff0dfabbb77a5ff4 to your computer and use it in GitHub Desktop.
Truncate all tables in a MySQL database when you don't have permission to drop and create database.
mysqldump -h[DB-HOST] -u[DB-USER] -p[DB-PASS] --add-drop-table --no-data [DB-NAME] | grep -e '^DROP \| FOREIGN_KEY_CHECKS' | mysql -h[DB-HOST] -u[DB-USER] -p[DB-PASS] [DB-NAME]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment