Skip to content

Instantly share code, notes, and snippets.

@seabre
Created January 23, 2012 18:29
Show Gist options
  • Save seabre/1664683 to your computer and use it in GitHub Desktop.
Save seabre/1664683 to your computer and use it in GitHub Desktop.
Dump and Restore MySQL Database

#Dump and Restore MySQL DB Quick Ref

##Dump The MySQL Table

mysqldump -u username -p -r my_output.sql my_database

##Compress Output with 7zip using the PPMd Algorithm

7z a -t7z my_output.7z my_output.sql -m0=PPMd

##Decompress Output with 7zip

7z e my_output.7z

##Restore The MySQL Table

mysql -u username -p my_database < my_output.sql

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