tags:

views:

5315

answers:

10
+24  Q: 

MySQL Diff Tool

Does anyone know any visual MySQL diff tools?

I have about 10 machines all with their own instance of MySQL. No replication is taking place, since each machine acts independently of the others. However, their table structures must be identical, and I would like a quick way to verify their table structures.

I'm not so concerned about the data in the tables. However, if the tool supports table data comparisons, I'd definitely like to check that out, too.

If you've worked with a good command-line tool, I'm open to that as well.

+20  A: 

Toad® for MySQL can do both a "Schema Compare" as well as a "Data Compare" (and a lot more).

By the way: the software is freeware - in case somebody asks.

Stefan Gehrig
I know Toad for Oracle does this, I would assume it's in there for MySQL as well.
Anson Smith
Just checked and yes - Toad for MySQL can do both.
Stefan Gehrig
it's also a windows only program.
Omry
Apparently, it requires full root privileges in both servers :( But it has like 20 visual themes to choose for!
Álvaro G. Vicario
A: 

Maatkit has a tool for ensuring tables on two database instances are in sync, but operates on data rather than just schema. Doing something with diff and the output of show create table <table>; on the two nodes you're trying to compare would seem to be the easiest way of doing what you're talking about.

Jon Topper
yep, i've done exactly that (mysqldump --no-data | diff - otherschema.sql) to stay in sync.
Javier
+6  A: 

Try mysql-diff. It does good job comparing table structures, but does not support all modern MySQL features. It is command line and free.

stepancheg
Gave you an up because your rating was on 666: couldn't have that.
Rich
A: 

Try Database compare tool by Nob Hill. Its for Schema compare like you wish and also data compare. (for MySQL or SQL)

Itamar
A: 

In case you use hibernate then you can also do it with SchemaValidate.

cherouvim
+1  A: 

I just accomplished this with the "Structure Synchronization" tool in Navicat. It analyzed two databases, presented the differences in a color-coded tree, and offers to run the SQL to bring the target up-to-date with the source.

It lets you save synchronization profiles, which I'm sure will come in handy for deploying updates to the Django (python manage.py syncdb stinks!) app I'm working on.

One catch was I had to turn off comparing indexes because the unique identifiers on each host were different:

  `group_id_refs_id_f116770`(group_id) != `group_id_refs_id_fee9890`(group_id)
Matt Miller
+1  A: 

Here's a Perl module that can diff two MySQL database schemas:

SQL Translator: sqlt-diff

http://search.cpan.org/~ribasushi/SQL-Translator-0.11005/script/sqlt-diff

Neil
A: 

Zidsoft CompareData can compare both table data and/or structure. It is based on ODBC so it works with any DBMS that has an ODBC-compliant driver including MySQL.

Farid Z
+1  A: 

You should take a look at Devart's database compare tools for MySQL:

Devart