# Mirroring mySQL using Git

3 messages from 2008-05-06 to 2008-05-06. Participants: Ryan Taylor, Luciano Rocha, Matthias Kestenholz.
Thread: https://gitlist.dev/t/13395

## Ryan Taylor, 2008-05-06 13:03

Subject: Mirroring mySQL using Git
Message-ID: <4B58A837F454E14AA0453EDBADE96A62B5F2A2@mildred.leeds-art.ac.uk>
URL: https://gitlist.dev/e/4B58A837F454E14AA0453EDBADE96A62B5F2A2%40mildred.leeds-art.ac.uk

```
Hi,

I'm wanting to mirror my mysql databases from my live web box to my dev
box. The database are updated by a CMS on the live box and I need to be
able to transfer these updates to the dev box.

Is this possible with git?

And if so how?

Cheers

Ryan

```

## Luciano Rocha, 2008-05-06 13:24

Subject: Re: Mirroring mySQL using Git
Message-ID: <20080506132422.GA13125@bit.office.eurotux.com>
URL: https://gitlist.dev/e/20080506132422.GA13125%40bit.office.eurotux.com
In-Reply-To: <4B58A837F454E14AA0453EDBADE96A62B5F2A2@mildred.leeds-art.ac.uk>

```
On Tue, May 06, 2008 at 02:03:01PM +0100, Ryan Taylor wrote:
> Hi,
> 
> I'm wanting to mirror my mysql databases from my live web box to my dev
> box. The database are updated by a CMS on the live box and I need to be
> able to transfer these updates to the dev box.
> 
> Is this possible with git?

You'd be better off with asynchronous replication. See
<http://dev.mysql.com/doc/refman/5.0/en/replication.html>.

Note that you go the git route, or other file-based solution, you'll
have to freeze operations to the filesystem where the DBs reside, or
you'll corrupt the copy.

-- 
Luciano Rocha <luciano@eurotux.com>
Eurotux Informática, S.A. <http://www.eurotux.com/>

```

## Matthias Kestenholz, 2008-05-06 13:29

Subject: Re: Mirroring mySQL using Git
Message-ID: <1210080565.7022.11.camel@futex>
URL: https://gitlist.dev/e/1210080565.7022.11.camel%40futex
In-Reply-To: <20080506132422.GA13125@bit.office.eurotux.com>

```
On Tue, 2008-05-06 at 14:24 +0100, Luciano Rocha wrote:
> On Tue, May 06, 2008 at 02:03:01PM +0100, Ryan Taylor wrote:
> > Hi,
> > 
> > I'm wanting to mirror my mysql databases from my live web box to my dev
> > box. The database are updated by a CMS on the live box and I need to be
> > able to transfer these updates to the dev box.
> > 
> > Is this possible with git?
> 
> You'd be better off with asynchronous replication. See
> <http://dev.mysql.com/doc/refman/5.0/en/replication.html>.
> 
> Note that you go the git route, or other file-based solution, you'll
> have to freeze operations to the filesystem where the DBs reside, or
> you'll corrupt the copy.

Alternatively, you can save a SQL dump without extended inserts and with
all comments stripped (especially the embedded timestamp).

Still, replication is a much better alternative (if possible).

-- 
http://spinlock.ch/blog/

```
