Sam's Tech Blog

You can check out any time you like, But you can never leave!'

2019-08-21

Create and restore MySQL database from compressed backup

How to: Create and restore MySQL database from compressed backup

Create and restore MySQL database from compressed backup

mysql -uroot -pMYPASSWORD -e "create database c24db" && zcat /mnt/backup/webmin/c24db.sql.gz | mysql -uroot -pMYPASSWORD c24db