mysqldiff -- a utility for comparing MySQL database structures

New! Update 2011/11/6: Finally a new release! (0.43) - available here or from CPAN.

What does it do?

mysqldiff is a Perl script front-end to the CPAN module MySQL::Diff which compares the data structures (i.e. schema / table definitions) of two MySQL databases, and returns the differences as a sequence of MySQL commands suitable for piping into mysql which will transform the structure of the first database to be identical to that of the second (c.f. diff and patch). Database structures can be compared whether they are files containing table definitions or existing databases, local or remote.

N.B. The program makes no attempt to compare any of the data which may be stored in the databases. It is purely for comparing the table definitions. I have no plans to implement data comparison; it is a complex problem and I have no need of such functionality anyway. However there is another program coldiff which does this, and is based on an older program called datadiff which seems to have vanished off the 'net.

For PostgreSQL there are similar tools such as pgdiff and apgdiff.

Where can I download it?

Here is the latest version of mysqldiff (what's new?); however it is strongly recommended that you install from CPAN via normal CPAN installation mechanisms. There is also a git repository.

How do I use it?

Please see the mysqldiff manual page.

How does it work?

Please see the INTERNALS section in the mysqldiff manual page.

Support, development, bugs, contributing etc.

Please see the development wiki.

Browser independent HTML! Valid CSS! Valid HTML 4.0!

Last updated: 2011-10-06 Thu 17:01:25 BST
© 1995 Adam Spiers <>