Created
May 15, 2013 23:19
-
-
Save Alcar32/5588204 to your computer and use it in GitHub Desktop.
How to back up and restore a MySQL database
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Back up from the command line (using mysqldump) | |
mysqldump --opt -u [uname] -p[pass] [dbname] > [backupfile.sql] | |
# Back up the MySQL database | |
mysqldump -u [uname] -p[pass] [dbname] | gzip -9 > [backupfile.sql.gz] | |
# Restoring the MySQL database | |
mysql -u [uname] -p[pass] [db_to_restore] < [backupfile.sql] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment