mysql database Multi-master replication on dynamic ip mysql database Multi-master replication on dynamic ip database database

mysql database Multi-master replication on dynamic ip


Yes you can do this with replication. Just pick which server you want to be the master and have the second one send all of its changes to the main one then the main one could send its changes back.

Replication can be a bit daunting to set up but once its up and running its grate. http://dev.mysql.com/doc/refman/5.0/en/replication-howto.html


Let's first analyze your question:

  1. The problem of accessing MySQL with a dynamic ip.This is very easy. Once you installed MySQL on a server with an ever-changing IP, what you can do is go to NO-IP, DynDNS or any other Dynamic DNS service and register for free with them. Once you've registered with them, you would get a client for your operating system. Install that and then you can access your MySQL server using a domain name.

    Example: Instead of having to access your server at 127.0.0.1, you can access it as mysql-server.easynet.net etc.

  2. Now the second and albeit complex part of your question, how to do available and lazy replication. This is relatively a bit more complex than the previous step. But, what actually happens is that you have to choose a scheme of replication. Basically what you are looking for here is MASTER-MASTER replication since you have a possibility of changes happening at both the MySQL servers. Thus the updates need to be bi-directional, that's what this scheme of replication does. How to do it? Well, I am providing the links which I've found easier to follow:

Master-Master Replication

Step-by-step MySQL Master Replication

I hope that would ease your plight and answer your question!Cheers!


Sure, you can
You need to setup both MySQL servers as Master and Slave at the same time.
Configure the online server as Master, and the localhost server as slave, and once replication is OK.
Configure the localhost as Master and the online server as slave.
I already did that on two servers.

About the dynamic IP on the local host, simply you can use any dynamic IP service like: no-ip, and use the dns name instead of the IP.