How to backup MySQL on Attix5 Server Edition 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 Attix5 SE client software will then backup this dump file.

Windows Setup

  1. Install the Script plug-in using the Attix5 plug-in installer installed found on the Downloads page.
  2. Create a directory where the dump file will be dumped to, eg c:\MySQLdump\
  3. 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.
  4. Save this notepad file to your Attix5 Pro\Backup Client SE\ installation directory as a ".bat" file (not .txt). In This example we have used A5MySQLDump.bat
  5. Test the script by opening a Windows command line prompt. Navigate to the location where you saved the script, enter the name of the script and press Enter. The script should dump the database to the c:\MySQLdump folder. If it does not, check the error and fix any spelling issues. 
  6. Open Attix5 SE client and go to Tools, Plugins, Scripting.
  7. Click Add to add a new script.

    Backup Script

  8. Enter a name for the script and set the script to run on "Backup Start".
  9. In the "Execute" field, enter the full path of the script.
  10. In the "Execute in folder" field, enter the path of the mysqldump executable file - usually the "bin" directory of the MySQL folder.
  11. Tick "Wait for process to complete" checkbox and tick "Abort backup if exit code is not 0". Click Ok and Ok again to return to the user interface.
  12. In the selection tree, select the folder for backup that you created the dump file. In our example it was c:\MySQLdump\
  13. Click "Backup" to start the backup process.

The database should then be dumped to the specified folder and this folder should be backed up. The most common errors are spelling mistakes in the script for 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.

0 (0)
Article Rating (No Votes)
Rate this article
    Attached Files (1)
    Comments
    There are no comments for this article. Be the first to post a comment.
    Name
    Email
    Security Code Security Code
    Related Articles RSS Feed
    How to Backup Windows System State
    Viewed 1879 times since Sun, Aug 16, 2015
    How to Backup Hyper-V Guests
    Viewed 1870 times since Thu, Aug 13, 2015
    How to calculate your backup upload speed
    Viewed 3011 times since Fri, Jun 27, 2014
    How to restore a MS SQL database using the Attix5 VSS plug-in
    Viewed 3617 times since Wed, Nov 12, 2014
    How to restore an Exchange database using the Attix5 VSS plug-in
    Viewed 2757 times since Wed, Nov 5, 2014
    How to backup a MS SQL database using the Attix5 VSS plug-in
    Viewed 6356 times since Wed, Nov 12, 2014
    How to Run a Snapshot Export Backup
    Viewed 1579 times since Sun, Aug 16, 2015
    How to Restore Windows System State
    Viewed 1979 times since Sun, Aug 16, 2015