开发者

How to Sync MySQL with python?

Im setting a VM.

Both h开发者_如何学运维ost and VM machine have Mysql. How do keep the VM Mysql sync'd to to the host Mysql. Host is using MYsql 5.5 on XP. VM is Mysql 5.1 on Fedora 14.

1) I could DUMP to "shared," Restore. Not sure if this will work. 2) I could network Mysql Host to Mysql VM. Not how to do this

How would I do this with python 2.7?

I dont want them in sync after set-up phase. But, maybe sync some tables or SP occasionly on-rewrites. After I build out Linux Env. I would like to be able to convert V2P and have a dual-boot system.


You can use mysqldump to make snapshots of the database, and to restore it to known states after tests.

But instead or going into the complication of synchronizing different database instances, it would be best to open the host machine's instance to local network access, and have the applications in the virtual machine access that as if it was a remote server. Overall performance should improve too.

Even if you decide to run different databases for the host and the guest, run then both on the host's MySQL instance. Performance will be better, configuration management will be easier, and the apps in the guest will be tested against a realistic deployment environment.


Why are you using Python? Just use the built in replication abilities: http://dev.mysql.com/doc/refman/5.5/en/replication.html


Do you want it synced in realtime?

Why not just connect the guest's mysql process to the host?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜