How to connect 2 Databases with each other which are present on 2 Different Machines

162 Views Asked by At

I have a website which is is connected to a local machine. both machines are Running and PHP applications with with same databases and tables and i want to update my Website's database when my Local Machine's database got Updated. How Can i do this ?

If your answer is REPLICATION then please explain me the whole procedure because i already tried ( Here I am using 2 Machines both are on localhost and both are working on Windows 8 ) that but it is not working.

I watch the several Tutorials on YouTube as well but nothing happens i don't know where is the problem because in those Tutorials it is working fine but on my machines it is not working at all....

1

There are 1 best solutions below

0
On

If your M2 machine (website) is able to access the machine M1 (local), then you can set up master slave replication where master is M1 and the necessary condition is M2 can't used for insert update. If you want that M2 also takes part into insert update, then you set master-master replication.

else you can set up cron job at machine M1 which takes incremental backup of mysql server databases by read binary logs example all transactions of yesterday & restored to machine M2.