Jump to content

Automated backup of MySQL Database?


dmccabe

Recommended Posts

I am running a wordpress installation on an internal web server as I am going to use it as a backend for our intranet.

 

It is running through IIS on a  Windows 2000 server.

 

Can anyone tell me how I would go about creating an automated backup of the mysql database ?

 

Edit: - If my database is called "wp" do I simply need to backup the \\lch-web1\c$\MySQL\data\wp directory on the server?

Link to comment
Share on other sites

Edit: - If my database is called "wp" do I simply need to backup the \\lch-web1\c$\MySQL\data\wp directory on the server?

 

I wouldn't do that. Use an sql dump instead. Here is a batch file I just wrote that is based off of a tutorial by phpfreak

sql_backup.bat

@echo off
call mysqldump --opt -c -e -Q -u %1 -p%2 %3 > %4

 

Usage:

  sql_backup mysql_user mysql_pass database_name output_file

 

To make it more automatic you could add a scheduled task that would run that script every x hours or whatever. This also assumes that you have C:\path\to\mysql\bin in your path.

 

 

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.