Creating a local web application

Put in and out basic data on locally created mysql
The remote mysql may also be changed directly.
Mysql has the same local and remote structure.

I want to merge with local mysql and remote mysql with the latest information

Local mysql is implemented with MAMP.
We want to implement the merge function in PHP.

What are your options?
Or if you have any reference sites, please let me know.

There was a "Gug with mysql replication", but is there any doubt that this has a parent-child relationship and there is no way to change the parent DB from the child DB?