An example of a MySQL database "dump" backup is described below.
- MySQL server installation, including mysqldump.exe
- Some dump space on disk that needs to be included in the selection.
- Permission to write to the dump location. This may need to be explicitly granted to the Backup Pro service user.
- A user with sufficient rights to backup MySQL.
1. Create the Script
Create a batch file containing the following:
cd <path to MySQL bin folder>
mysqldump --opt -h <hostname> -u <user> --password=<password> <database name> > <dump path out>
If backing up �?oEngineering�?� to C:\MySQLDump\Engineering.txt using the username �?oredstor�?� and password �?oPassword123:
cd "C:\Program Files\MySQL\MySQL Server 5.7\bin"
mysqldump --opt -h localhost -u redstor --password=Password123 engineering > C:\MySQLdump\engineering.txt
Back up multiple databases
Should you wish to backup multiple databases, these can be specified by repeating the "mysqldump" command with different database names and filenames.
mysqldump --opt -h localhost -u redstor --password=Password123 finance > C:\MySQLdump\finance.txt
Note: Use a static filename for dumped MySQL backup files (.txt in the examples above), so that files will be patched and not added as new files.
2. Test the Script
It is strongly recommended to test the backup script from the command line before adding it to the Backup Client for execution.
3. Configure the Script in the Backup Client
Add the script to the backup client configuration, set to run before each backup.
4. Add the Script to the Backup Selection
Ensure that the dump locations are included in the backup selection.