Last active
August 29, 2015 14:05
-
-
Save otkrsk/9189f652e6c53670fbcf to your computer and use it in GitHub Desktop.
Backup and Restore MySQL Dump
This file contains hidden or 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
| #backup all databases in one file (eventually add the option --add-locks): | |
| mysqldump -u [username] -p[root_password] [database_name] > file.sql | |
| #backup all databases in one gzipped file: | |
| mysqldump -u [username] -p[password] -–all-databases | gzip > file.sql.gz | |
| #restore all databases: | |
| mysql -u [username] -p[password] < file.sql |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment