Mysql – Update two tables, each on separate MySQL servers, on two different machines in one query


Have two MySQL servers running on two different machines in a local network. Using PHP and accessing via IP. No problems there. The databases have identical schemas. One was an import from the other machine.

Want to run ONE query that updates the same table on each server simultaneously. Already have existing queries and do not want to update them extensively. Is there a simple way to do this?

I'm looking to keep the databases in sync when an update occurs.

Also open to any suggestions regarding another way to keep the databases in sync.

Best Answer

If you update one server only, master/slave replication is sufficient, otherwise group replication or galera