This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JDBC and the fly likes Schema Comparison Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Schema Comparison" Watch "Schema Comparison" New topic

Schema Comparison

Kirstin Schapitz

Joined: Aug 31, 2008
Posts: 7
I need to compare 2 mysql database schemas (tables, columns, used data types, keys, constraints) and would like to have the differences displayed.
Is there any free tool that can be run from the command line and which generates a report? Or is there a nice Java API which I can use? I know, there is some useful stuff in java.sql... where I would still need to do some programming to get what I need... I only want to do this if there is no other solution.
Thanks a lot in advance.
Jeanne Boyarsky
internet detective

Joined: May 26, 2003
Posts: 30138

The "procedure" I use is to create a schema export in both databases and run the UNIX "diff" command against them.

[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Kirstin Schapitz

Joined: Aug 31, 2008
Posts: 7
Yes, the diff solution is the easiest, but not the nicest because it doesnt tell you "contraint xyz is missing" for example...
I agree. Here's the link:
subject: Schema Comparison
Similar Threads
Color text in JTextArea
Speech recognition
software to acess the websphere 4.0 remotely
Equivalent of COM/OLE
maven and manifest file