Mati's Blog

Backup/Restore MySQL database by Terminal

If you want to backup/restore your database, run the following command:

Backup Database:
mysqldump -u database_user -p database_name | gzip > file_name.sql.gz

Restore Database:
gunzip < file_name.sql.gz | mysql -u database_user -p database_name


2019 © Tien Mai. Powered by MatiFly