Last active
August 29, 2015 14:11
-
-
Save xerardoo/e525553f41c14f95c10d to your computer and use it in GitHub Desktop.
Restore and Backup MySQL Databases .
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
Source: https://snipt.net/danfreak/backup-and-restore-all-mysql-databases-with-2-simple-commands/ | |
#backup all databases in one file (eventually add the option --add-locks): | |
mysqldump -u username -p -–all-databases > file.sql | |
#backup all databases in one gzipped file: | |
mysqldump -u username -p -–all-databases | gzip > file.sql.gz | |
#restore all databases: | |
mysql -u username -p < file.sql |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment