Skip to content

Instantly share code, notes, and snippets.

@abhiomkar
Created June 15, 2011 09:00
Show Gist options
  • Save abhiomkar/1026741 to your computer and use it in GitHub Desktop.
Save abhiomkar/1026741 to your computer and use it in GitHub Desktop.
MySQL Backup/Restore Script
# Backup using MySQL Dump
mysqldump --user=root --password=very_strong_password --database mydb > ~/backups/mydb_backup_$(date '+%F_%H%M%S').sql
# Restore
mysql --verbose --user=root --password=very_strong_password mydb < ~/backups/mydb_backup_2011-06-15_085322.sql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment