Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I'm developing a software in windows blends and i need it to be syncronized with my online server mysql database. I have local mysql database which i use for the app. The app also have an online version in php with a mysql database. so the user can enter either by the online version or offline app. So i need both the databases to be syncronized so when a data is entered online it will be reflected in the software app. I need seperate databases because when the app is not connected to internet, it should work perfectly and when reconnected it should start synchronization both ways i.e. from local to online and from online to local database.

So basically i need 2 mysql databases to be synchronized bothways where one is local and other online.

Also how to find out when a synchronization breaks?

share|improve this question

migrated from stackoverflow.com Mar 28 '12 at 12:39

This question came from our site for professional and enthusiast programmers.

    
Read about database replication. Scenario you need is master-master. –  N.B. Mar 27 '12 at 12:17
    
@N.B. I read about it. But that is not what i need. The thing i need is not a backup that has the same contents as the first database. Each database is dealt seperately and should be synchronized in bothways i.e Contents in master 1 that are not in master 2 should be inserted or updated and vice-versa... (The page i read -> howtoforge.com/mysql_master_master_replication ) –  hablema Mar 27 '12 at 12:25
    
Replication isn't used exclusively for backups, it's used to synchronize databases as well (among other things). If you have your local database use even numbers for auto_increments and your online one to use odd numbers for auto_increments, you avoid clashes and both databases will replicate onto each other. That's the point of master-master, so you can use both, not have one as a backup. –  N.B. Mar 27 '12 at 12:38
    
Have a look at Schema and Data comparison/synchronization tools in dbForge Studio for MySQL - devart.com/dbforge/mysql/studio –  Devart Mar 28 '12 at 6:15
    
If you're looking for "High Availability", you should look into Asynchronous Replication. Here's a good article on it: clusterdb.com/mysql-cluster/… –  nojak Jun 27 '12 at 16:25

2 Answers 2

Schedule a job to backup one database and apply the backup script to another, that way you never need to worry about the synchronization as it is done automatically on a schedule

share|improve this answer

SQLyog has Database Synchronization which has Two way synchronization option as well. In your case local --> online and Online --> local , you can easily do, I hope this helps.

Otherwise, Try configuring Master-Master replication set up.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.