How to sync mysql db between 2 localhost?
i want to develop some php stuff with a friend together. We managed to sync our local projects with an subversion repository on unfuddle.com a开发者_StackOverflow中文版nd with subclipse. Now we need to now how to synchronize the local mysql databases, too. (We both use xampp and we want to use Mysql Workbench to mange the tables)
It's not an option for us to use an online database, because we want to able to write and test code offline.
I'm really a noob at mysql dbs, i just know how to let my php work with them. so a programm or a eclipse plug-in which could let use the unfuddle repository would be perfect.
Thank you very much,
Someonelse
First of all, it's a bad idea to share a development database. It makes it very difficult to get consistency when other people may be modifying your data. It will very likely interfere with your thought process while coding.
I would recommend adding your database schema (or snapshots) to the svn repository and load them on each database instead. Once you get more comfortable with this, you can start looking at using an ORM like Propel to manage your database schema and preferably a whole framework like Symfony as well.
Now, if you're really stubborn about doing this (and a little crazy too) If you're in the same LAN, look at master-master replication.. It might work remotely too, but depending on the amount of data being read/written it might be really laggy. Again, you'll likely end up having problems regardless of what route you go with if you decide to share a single db.
Cheers!
精彩评论