BackupVault Knowledgebase

How to backup MySQL using BackupVault Pro for Windows


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

  1. Create a directory where the dump file will be dumped to, eg c:\MySQLdump\
  2. 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.
  3. 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
  4. Open the BackupVault Pro client and click OptionsBackup Scripts.
  5. Tick Run this script before each backup and browse to the bat file you previously created.           
  6. Click Ok to close the Options.
  7. Ensure that the C:\MySQLDump location is included in the backup selection.
  8. Click Backup to start the backup process.

The backup software will then execute the script and dump the output to the c:\MySQLdump folder.

Tip: Always test a new script in using the Windows command line or PowerShell to ensure it works as expected. A common error is the incorrect location of the mysqldump.exe executable.

Other common errors are spelling mistake in the script, specifically the username, database and password.

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.