Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there any program, source code or API that will take a MySQL or PostgreSQL schema and spit out a UML or some other graph visualizing of it?

share|improve this question

A useful little protip - Visio is quite widely available within corporate I.T. suites and Visio Pro or higher can be used to reverse engineer and document a database.

Visio professional has a database reverse engineering tool that will read a database schema and create E-R models from it. Both PostgreSQL and MySQL support ODBC INFORMATION_SCHEMA tables so the ODBC driver for the Visio DB modeller will work with them. Start by creating a database diagram, and then look for 'Reverse Engineer' under the 'Database' menu.

As a bonus, if the physical DB has missing foreign key constraints you can add them back into the model for documentation purposes. For a more complex schema you can also create several diagrams showing different subsystems. I find myself using this to document systems at client sites on a semi-regular basis and it's often the only tool available.

share|improve this answer

You mean something like SQL Power Architect? The open source version can be found here.

share|improve this answer

Take a look at SchemaSpy. It creates quite nice reports and diagrams:

share|improve this answer

MySQL Workbench will do this for MySQL databases.

share|improve this answer
Hey, Just wanted to add, I used this one, and it looks nice, however it doesnt auto detect relationships for me since they are in singular-plural fashion (users -> user_id), So I had to do it myself. The last button does this, shortcut is 6 – Karthik T May 13 '14 at 5:20

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.