Skip to content

Instantly share code, notes, and snippets.

@xerardoo
Last active August 29, 2015 14:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xerardoo/e525553f41c14f95c10d to your computer and use it in GitHub Desktop.
Save xerardoo/e525553f41c14f95c10d to your computer and use it in GitHub Desktop.
Restore and Backup MySQL Databases .
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