How to backup MySQL database on Windows?

The rough equivalent of crontab -e for Windows is the at command, as in:

at 22:00 /every:M,T,W,Th,F C:\path\to\mysql\bin\mysqldump.exe ...

Running the at command by itself lists the tasks you've created using at.

The mysqldump documentation is here.


The most popular way to backup MySQL database is to use mysqldump:

  1. Open a Windows command line.

  2. Specify the directory to mysqldump utility

    cd "C:\Program Files\MySQL\MySQL Server 5.7\bin"

  3. Create a dump of your MySQL database.

mysqldump.exe --user=YourUserName --password=YourPassword --host=localhost --port=3306 --result-file="Pathdump.sql" --databases "DatabaseName"

Also, there are a lot of third-party tools, which can perform MySQL backups automatically on a regular basis.