Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How I make a local MySQL database update a mirror on internet all the time it is possible?

share|improve this question
up vote 6 down vote accepted

You'll need to setup MySQL replication. You can find thorough docs here:

I agree with Craig, but I've had issues with MySQL and SSL over the Internet. I've actually used SSH tunnels instead and they've worked remarkably well. I use a wrapper called autossh ( to manage the connections if they die.

If you're interested, here's the command I've used (note you only need to set it up on one end of the tunnel since this connection creates a bi-directional communication channel):

# /usr/bin/ssh -2 -N -o ServerAliveInterval=15 -i /root/.ssh/id_rsa -N -R \
  13306: -L 13306: root@<REMOTEIP>

What this does is create a tunnel on port 13306 on both ends to the MySQL instance running on the other side. To setup replication, you point the "master" server to on port 13306. To wrap it with autossh, use this command:

# /usr/local/bin/autossh -2 -fN -M 20000 -o ServerAliveInterval=15\
 -i /root/.ssh/id_rsa -N -R 13306: -L 13306: root@<REMOTEIP>

Good Luck!

share|improve this answer

You can set up MySQL to perform replication over SSL. We replicate one our servers from the midwest to the west coast over SSL, 150K+ records/day without problem. But, it requires access to the configuration of the slave server (the mirror in your question).

share|improve this answer

I think you're looking for MySQL replication

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.