Welcome to WebmasterWorld Guest from 54.144.243.34

Forum Moderators: open

Synchronise local db (master) with remote db (slave)

   
5:40 am on Oct 21, 2010 (gmt 0)

5+ Year Member



Hi all,

I have a project where I have to sync a local mysql db with a hosted remote one.

The local mysql db is on a usb stick and runs on a portable web server. If any changes are made to the remote, hosted (master) db, these changes should reflect to the local (slave) db with an update script (preferably php). If possible, only updated, changed, newer entries should be synchronised.

Ever done this? Any ideas how I should approach this issue?

Thanks
9:10 pm on Oct 21, 2010 (gmt 0)

WebmasterWorld Senior Member whoisgregg is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Setting up replication isn't too difficult and then it takes care of this for you. Take a look at the documentation [dev.mysql.com] and post back if you have any questions. :)
12:03 am on Oct 22, 2010 (gmt 0)

5+ Year Member



@whoisgregg
Thanks for your hint.
I rang my hosting provider and they said it is not possible to set the server ID, required for replication. So, I have to find another way of doing this.
12:09 am on Oct 22, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



>>The local mysql db is on a usb stick and runs on a portable web server

Huh?
12:16 am on Oct 22, 2010 (gmt 0)

5+ Year Member



Yes, the loacal db is on a usb stick as part of a web app and has status "slave". The "master" sits on a hosted environment. Changes made to the master should be syncable to slaves.
 

Featured Threads

My Threads

Hot Threads This Week

Hot Threads This Month