I have two servers that need to be synced. One is online and has a public IP address. The other is internal and has no public IP address - nor is there a way to get it a public IP so that's off the table.

I'd like to set up replication between the two servers through MySQL but as I understand it, the MySQL slave needs to be able to connect to the master (i.e. the master doesn't just simply push data out) and that's a problem since there's no public IP or interface to connect to.

Is there any way to replicate and simply tell the master to push data to the slave (which it can access)? Alternatively, is there some other solution? I have considered a mysqldump periodically but the data is going to grow very quickly resulting in too-large dump files.

  • just dump changes. etl and partitioning are your friends here.
    – duffymo
    Jan 30, 2014 at 15:23
  • If both are on the same network you should be able to use internal ips even if only one is configured with a public.
    – Panama Jack
    Jan 30, 2014 at 15:26
  • The answer you are looking for maybe found here: stackoverflow.com/questions/7722659/…
    – user2881767
    Jan 30, 2014 at 15:33

2 Answers 2


Make sure that you are able to connect to Remote MySQL server (Online server) from a Slave server machine. You can verify by using telnet command

# telnet <online server IP><space><MySQL port>

Now follow the replication procedures mentioned here:


For Database synchronization refer existing answer here:



At first, create OpenVPN Server on your online database server.

Then, connect from your internal database server to your online database server.

Now, your database server should be able to PING each other, and can be set to use normal replication as it should.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.