Backup mysql from incurable

I have actually set up a cron work to backup mysql data sources on ubuntu9.10. I made use of the adhering to access in the cron documents.

37 4 * * * root /usr/bin/mysqldump -u root -p<mysql-password> --all-databases > /usr/backup/mysqlbkup/all-databases.sql

It supports all the data sources places in a file called 'all - databases.sql'. This is what I desired. Yet if I intend to recover a solitary data source I will certainly need to recover all the data sources. Exists any kind of method to backup all mysql data sources to a directory site with their data source name independently?.

0
2019-05-18 20:29:23
Source Share
Answers: 1

I recommend you read: http://dev.mysql.com/doc/refman/5.1/en/mysqldump.html

You can unload various data sources with: mysqldump [alternatives ] - - data sources DB1 [DB2 DB3 ... ]

You simply need to add a cronjob for each and every data source:

37 4 * * * root /usr/bin/mysqldump -u root -p<mysql-password> --databases database1 > /usr/backup/mysqlbkup/databases1.sql
38 4 * * * root /usr/bin/mysqldump -u root -p<mysql-password> --databases database2  database3 > /usr/backup/mysqlbkup/databases2_3.sql

Ofcourse you can make one bash manuscript for all various data sources and also run that manuscript from the crontab. Additionally i would certainly gzip it up.

Goodluck

0
2019-05-21 03:15:33
Source