Is it possible to create an automated "Export database as SQL" for backup purposes?

[expired user #10237]'s profile image [expired user #10237] posted 7 years ago in Import/Export Permalink

Can you schedule an automated "Export database as SQL" command in HeidiSQL?

I am using WAMP and HeidiSQL and I need a way to automatically backup the data.

Is this possible? Is there a workaround?

Thank you. NJ

kalvaro's profile image kalvaro posted 7 years ago Permalink

This gets asked often. Why even care, when you have mysqldump?

ansgar's profile image ansgar posted 7 years ago Permalink

Not with HeidiSQL, as you can read in the help section for command line parameters.

You can use mysqldump.exe from the MySQL server download instead:

c:\>"Program Files\MySQL xyz\bin\mysqldump.exe" -hlocalhost -uroot --opt --result-file=mybackup.sql mydatabase

The Windows Task Scheduler lets you then schedule any command line program:

  1. Open a command prompt and type Taskschd.msc
  2. create a new scheduled task, with the appropriate command line as "action"

See the Microsoft Technet doc: https://technet.microsoft.com/en-gb/library/cc721931(v=ws.11).aspx

Please login to leave a reply, or register at first.