Linux - backup ALL MySQL databases

 

Linux - backup ALL MySQL databases

mysqldump -u root -h localhost -pMyPassword -A | gzip -9 > allmy-db.sql.gz

backup all database from srv to allmy-db.sql.gz file!

———-

To restore compressed backup files you can do the following:

gunzip < allmy-db.sql.gz | mysql -u root -pMyPassword

or uncompress gz file: gunzip allmy-db.sql.gz

and use:
mysql -u root -pMyPassword -h localhost -A < /path/allmy-db.sql
or
mysql
-u root -pMyPassword -h localhost -e “source /path/allmy-db.sql” -A

Tags: , , ,
Posted under Bookmarks, Linux |

Post a Comment



We use third-party advertising companies to serve ads when you visit our website. These companies may use information (not including your name, address, email address, or telephone number) about your visits to this and other websites in order to provide advertisements about goods and services of interest to you.