6

How to do automatic mysql db backup using mysql workbench?

alt text

Is it possible?

3 Answers 3

10

Mysql bench is not required for automatic backup,
setup a crontab and use mysqldump (or equivalent) will do the same job and is easier.

example:

crontab -e

/* backup every day at 00:00:00 */
0 0 * * * mysqldump -u root -ppassword YOUR_DATABASE > /backup/YOUR_DATABASE.sql
Sign up to request clarification or add additional context in comments.

3 Comments

I'm currently using task scheduler for windows to do that. I just want to learn other methods of doing it, that's why I asked. But thanks anyway.
Of course you might want to actually wrap a little script around that to rotate the backups using some sort of aging system (like keep every daily for that last week, every weekly for the last quarter and every quarterly forever ... or something like that). Might want to use ~/.my.cnf to hide your admin/root password there rather in the cron subsystem.
While I personally prefer mysqldump, it may be easier in some case to use Workbench functionality (e.g. it is really difficult for novices to make partial restore from huge mysqldump backup).
5

If you have a webserver with PHP I'd suggest MySqlDumper

It supports:

  • Automatic backups
  • Emails backups
  • Compresses backups
  • Rotates backups
  • etc.

1 Comment

MySqlDumper? Instructions are bad.
1

ATM scheduled backups are not plannned in Workbench: http://bugs.mysql.com/bug.php?id=50074

At the same time Workbench is designed to have powerful scripting shell, so you can try to investigate what commands can be used for backup and call them directly from shell. (But I agree this is too general idea):

http://dev.mysql.com/doc/workbench/en/wb-extending.html

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.