I need to setup a MySQL master and slave, between an office and a webserver in a datacenter.
The master will be in the office.
What would happen if the internet connection would fail in the office?
I assume the slave wil continue to work, but the slave and the master will no longer be in sync when the connection comes back.
Will MySQL / InnoDB correct for this?
Is there a way to make MySQL fix this automatically?
Does anyone have a working example?

MariaDB will be the database of choice.


It depends if you use statement-based or row-based replication. In both modes, theoretically when link comes up, master should just continue replication to slaves.

However if you use statement-based replication and queries that are unsafe for it, it can break.

On the other hand, row-based replication is completely safe, but it replicates much more data (all writes instead of just queries). So it can be hard for office link.

  • I am assuming row based, it is not that much data. – HyperDevil Jul 15 '15 at 10:59
  • So it just needs to catch up the delay. – Tomasz Klim Jul 15 '15 at 11:05
  • The rows that then have been inserted on the slave then need to be synced to the master. – HyperDevil Jul 15 '15 at 11:06
  • @HyperDevil Slaves do not sync to masters; the synchronization goes the other way. If you need something like that, then you want a multi-master setup (e.g. Galera cluster). – Michael Hampton Jul 15 '15 at 15:44
  • Of course slaves connect to master, but it's not about direction of the connection itself, but direction of data replication. Multi master is great, but not for situations, where you need full control of master data inside your office, and you have faulty internet link(s). – Tomasz Klim Jul 15 '15 at 16:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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