Link to home
Start Free TrialLog in
Avatar of Rush_2112
Rush_2112

asked on

Replicate data from one MySQL DB to another

Hi,

I have two servers, hosted by different companies.  Both running MySQL.  I was wondering if there's a script that could run automatically that would transfer all of the data in the DB from one server over to the other.  Preferable something that ran automatically, like every 4 hours.  The table structure would be the same on both servers.

Thanks
Avatar of Ferrosti
Ferrosti
Flag of Germany image

It depends on how you need to handle your data. What is the purpose of this scenario?
Usually one would go for a binary log and apply it to the second server (master/slave setup).
Avatar of arnold
Do you have direct access to the mysql servers?
I.e. you would have an application/script running locally that will connect to each mysql server and perform the select/if exists update else insert into the other.
You can configure the frequency within your local system as well as add the logic to speedup the process by not retrieving unchanged data unnecessarily.
Avatar of Rush_2112
Rush_2112

ASKER

Both servers are on shared hosting plans, so  I don't know if I have the kind of access you're talking about.  I was hoping there would be a msysql script that could auto-run.
ASKER CERTIFIED SOLUTION
Avatar of arnold
arnold
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial