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
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
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.
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.
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Usually one would go for a binary log and apply it to the second server (master/slave setup).