Comparing changes to MySQL databases

Published December 10th, 2008

One of my personal nightmares goes as follows: I’m working on an existing MySQL-based system, adding or changing something that involves altering existing database tables. I do what I need to, commit the code and then realise that I need to make the database changes too…only I’ve forgotten to keep track of the edits I’ve made. Oops.

Now there are various things I should┬ádo to prevent this happening — at the very least keep a list of changes as I’m going along, which I do…when I remember to. But on those occasions when I don’t, I usually end up dumping the schemas and comparing them using a diff tool, which works just fine but can be rather laborious.

Today I stumbled (via DZone) upon a piece of freeware called Toad for MySQL. It does a whole bunch of useful things, but the feature that stood out for me was its ‘schema compare’ tool. At first it looks like a dolled-up diff tool, but then you notice that in addition to showing you the differences between two databases, it also creates an SQL statement to convert between the two. Very handy.

For those of you who are allergic to MySQL, there are versions of Toad for Oracle, SQL Server and DB2 (although they’re not freeware).

Get a Trackback link


  1. alfatek on December 11, 2008

    Many thx for this. This is my dream product: schema/data compare, E-R, Object Navigator, all you’ll ever need…. Too bad SQL Server freeware version is not complete :(

Leave a comment

Comment Policy: First time comments are moderated. Please be patient.