[aklug] Re: Remote backup of MySQL database

From: Royce Williams <royce@tycho.org>
Date: Fri Feb 25 2011 - 05:54:46 AKST

Shane R. Spencer said, on 02/24/2011 10:00 AM:
> On 02/23/2011 09:03 PM, Christopher Howard wrote:
>> It's been a few years since I worked much with MySQL, but is there a
>> handy (open-source) tool these days for remote backup of a single MySQL
>> database? IIRC, mysqldump would do the trick, but it seems on my
>> distribution that you have to install the whole bloody MySQL server just
>> to get that program. Googling brought up some scripts where you do the
>> dump on the remote server, and then copy the file over to your machine,
>> but that is a bit less elegant than I would prefer.

What Shane said. :-)

Also, if any of your backup/transfer needs are in order to fuel being able to hit an exact copy of the data for development purposes, look into the Maatkit suite of tools from the Percona folks, especially "mk-table-sync", which is basically "diff" for MySQL tables. It spits out the list of SQL commands necessary to make one database look like the other.

Syntax example (using SSH tunnels to make the comparison between local and remote)

  mk-table-sync --no-check-slave --ignore-columns=updated --ask-pass --print \
    h=localhost,u=root,P=3306,D=mydatabase,t=mytable \
    h=127.0.0.1,u=root,P=3307,D=mydatabase,t=table

The other Maatkit tools are also veeeeery handy. Highly recommended. A summary of what the tools do is here:

    http://www.maatkit.org/doc/synopsis

Requires a couple of Perl modules.

Royce
---------
To unsubscribe, send email to <aklug-request@aklug.org>
with 'unsubscribe' in the message body.
Received on Fri Feb 25 05:54:57 2011

This archive was generated by hypermail 2.1.8 : Fri Feb 25 2011 - 05:54:58 AKST