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:
- Red-Gate's MySQL Schema & Data Compare (Commercial)
- Maatkit (now Percona)
- liquibase
- Toad
- Nob Hill Database Compare (Commercial)
- MySQL Diff
- SQL EDT (Commercial)
There is another open source command-line mysql-diff tool:
http://bitbucket.org/stepancheg/mysql-diff/
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.
There is a useful tool written using perl called Maatkit. It has several database comparison and syncing tools among other things.
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/
I think Navicat for MySQL will be helpful for this case. It supports Data and Structure Synchronization for MySQL.
There is a Schema Synchronization Tool in SQLyog (commercial) which generates SQL for synchronizing two databases.