Backup and Restore MySQL Database

Simple commands. To backup (with root password):

mysqldump -u root -p --all-databases | gzip > /backups/mybackup.gz

To restore:

zcat mybackup.gz | mysql -u root -p

Leave a Reply

Your email address will not be published. Required fields are marked *