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

I want to run a single (ONE) query that updates the same table on each server simultaneously. I already have existing queries and do not want to update them extensively.

Is there a simple way to achieve this?

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

I am also open to any other suggestions regarding other ways to keep the databases in sync.

  • 3
    What you are looking for is replication. Don't rely on your application to keep things in sync.
    – Dave
    Commented Oct 5, 2018 at 19:03

1 Answer 1


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

Your Answer

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

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