Compare two MySQL databases [closed]

2018-12-31 12:45发布

I'm currently developing an application using a MySQL database.

The database-structure is still in flux and changes while development progresses (I change my local copy, leaving the one on the test-server alone).

Is there a way to compare the two instances of the database to see if there were any changes?

While currently simply discarding the previous test server database is fine, as testing starts entering test data it could get a bit tricky.
The same though more so will happen again later in production...

Is there an easy way to incrementally make changes to the production database, preferably by automatically creating a script to modify it?


Tools mentioned in the answers:

21条回答
与君花间醉酒
2楼-- · 2018-12-31 12:45

There is another open source command-line mysql-diff tool:

http://bitbucket.org/stepancheg/mysql-diff/

查看更多
裙下三千臣
3楼-- · 2018-12-31 12:49

Take a look at dbForge Data Compare for MySQL. It's a shareware with 30-days free trial period. It's a fast MySQL GUI tool for data comparison and synchronization, management of data differences, and customizable synchronization.

dbForge Data Compare for MySQL

查看更多
春风洒进眼中
4楼-- · 2018-12-31 12:50

There is a useful tool written using perl called Maatkit. It has several database comparison and syncing tools among other things.

查看更多
素衣白纱
5楼-- · 2018-12-31 12:50

After hours searching on web for simple tool, i realized i didn't look in Ubuntu Software Center. Here is a free solution i found: http://torasql.com/ They claim to have a version for Windows also, but I'm only using it under Ubuntu.

Edit: 2015-Feb-05 If you need Windows tool, TOAD is perfect and free: http://software.dell.com/products/toad-for-mysql/

查看更多
心情的温度
6楼-- · 2018-12-31 12:50

I think Navicat for MySQL will be helpful for this case. It supports Data and Structure Synchronization for MySQL. enter image description here

查看更多
人气声优
7楼-- · 2018-12-31 12:52

There is a Schema Synchronization Tool in SQLyog (commercial) which generates SQL for synchronizing two databases.

enter image description here

查看更多
登录 后发表回答