How to automatically create backup of all customers MySQL databases?

Created:

2017-02-14 00:45:36 UTC

Modified:

2017-08-08 13:42:21 UTC

0

Was this article helpful?


Have more questions?

Submit a request

How to automatically create backup of all customers MySQL databases?

Applicable to:

  • Plesk for Windows

Question

How to automatically create backup of all customers MySQL databases? Note that this MySQL server uses port 3306 as default.

Answer

1. Go to Tools & Settings > Scheduled Tasks . Than click Add Task .

2. Specify the path to mysqldump.exe executable in the Command field. Copy the following code to the Command field:

%plesk_dir%\MySQL\bin\mysqldump.exe

3. Create backup folder in %plesk_dir%Databases\MySQL\ directory. Copy the following code to the with arguments field and edit it replacing <Password> with the current password of admin user of local MySQL database server.

-uadmin -p<Password> -P3306 --all-databases --events -r "%plesk_dir%Databases\MySQL\backup\backup_%date:~-10,2%.%date:~-7,2%.%date:~-4,4% at %time:~0,2%-%time:~3,2%.sql"

For example lets assume that the password is " password ". Then the resulting code should be as follows:

-uadmin -ppassword -P3306 --all-databases --events -r "%plesk_dir%Databases\MySQL\backup\backup_%date:~-10,2%.%date:~-7,2%.%date:~-4,4% at %time:~0,2%-%time:~3,2%.sql"

Note that output file will be named as e.g. "backup_02.14.17 at 22-00.sql" and the part after backup_ will be different regarding to the current date and time on the server. It is possible to specify another prefix name instead of backup_ name.

4. Specify the time when the task should be started in the line below and click Ok .

Have more questions? Submit a request
Please sign in to leave a comment.