To backup a MySQL database in Windows requires the user to dump a copy of the database first using the mysqldump utility. The BackupVault Pro software will then backup this dump file.
Setup the Script
- Create a directory where the dump file will be dumped to, eg c:\MySQLdump\
- Create a batch file using Notepad. Copy/paste the following:
mysqldump –opt -h hostname -u user –password=password database > C:\MySQLdump\testdump.sql
Note: you will need to change hostname, user, password and database to the correct parameters for your database. Ensure that this command is on one line only.
- Save this notepad file to your C:\Program Files\BackupVault\Backup Client ESE installation directory as a “.bat” file (not .txt). In This example we have used BackupVaultMySQLDump.bat
- Open the BackupVault Pro client and click Options, Backup Scripts.
- Tick Run this script before each backup and browse to the bat file you previously created.
- Click Ok to close the Options.
- Ensure that the C:\MySQLDump location is included in the backup selection.
- Click Backup to start the backup process.
The backup software will then execute the script and dump the output to the c:\MySQLdump folder.
Once the backup has completed, run a restore on this dump file testdump.sql and ensure that you can successfully restore it to a test database.