In this guide I will show you how you can automate the backup process of Mysql database using a simple trick in Windows. This is the Windows equivalent of the Cron jobs that are mostly used in Linux systems.
I’m using Windows 7 at the time of this writing but the process is still the same for Windows XP and Windows Vista.
Before we start, you must have already a knowledge on how to backup mysql database using mysqldump the built-in tool for mysql which I mainly use for backups.
Here’s the link to the last tutorial that I have made which discusses about the ways on how to backup mysql database. You might want to check it out first if you don’t have an idea on how to use mysqldump utility.
Lets begin by opening up the task scheduler
From this screen, you need to click on create basic task
Input the name of the task together with the description then click next
In this case I selected when I log on. You can choose whatever you want. Then click on next again.
We will select start a program here since we will be executing a batch file. A batch file is similar to an executable file. And you can convert a batch file to an executable easily. Click next again.
Browse for the batch file that backups mysql database or just enter its location on the input box provided. Then click next.
Just click on finish when you see this screen. Its just a summary of what the task will do.
To check if it is really saved then just scroll down to the active task section and try to find the name of the task in the list. Or just press on your keyboard the first letter of the task name. In my case, it is ‘D’ for db backup
That’s a nice and easy way on how to do mysql database backups automatically using the built in windows tool, the task scheduler. You can also try to be creative by doing some other task with this neat windows tool.