Skip to content

Instantly share code, notes, and snippets.

@claudinec
Created June 14, 2012 05:38
Show Gist options
  • Save claudinec/2928177 to your computer and use it in GitHub Desktop.
Save claudinec/2928177 to your computer and use it in GitHub Desktop.
# From http://www.thingy-ma-jig.co.uk/blog/10-10-2006/mysql-drop-all-tables
mysqldump -u[USERNAME] -p[PASSWORD] --add-drop-table --no-data [DATABASE] | grep ^DROP | mysql -u[USERNAME] -p[PASSWORD] [DATABASE]
@cafuego
Copy link

cafuego commented Jun 14, 2012

You'll want to also use "--triggers --quick --routines --master-data=2" on the backup, that grabs stored procedures and triggers, which otherwise don't get backed up. The master-data one grabs the binary log position for replication (if you use that). :-)

@claudinec
Copy link
Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment