Skip to content
Tim L edited this page May 3, 2013 · 5 revisions

What we will cover

This page describes how to generate an ERD diagram of an unknown mysql database (e.g. corpwatch's). First, we tried SchemaSpy, couldn't read from SQL scripts. Then, we MySQL Workbench to get what we want.

Let's get to it

SchemaSpy

http://schemaspy.sourceforge.net/

java -jar schemaSpy.jar -t <dbType> -db <dbName> [-s <schema>] -u <user> [-p <password>] -o <outputDir>
java -jar schemaSpy_5.0.0.jar -dbhelp

Built-in database types and their required connection parameters:
...
 mysql:
  MySQL
   -host   	hostname[:port] host where database resides with optional port
   -db   	database name
...
java -jar schemaSpy.jar -t mysql -db <dbName> --all -u <user> [-p <password>] -o <outputDir>

:: punt ::

MySQL Workbench

http://dev.mysql.com/workbench

  • Notice the "No thanks, just start my download." in the bottom left corner that lets you download without signing up.
  • "Data Modeling" center pane when the application loads, "Create EER Model from SQL Script".

database-diagram

https://code.google.com/p/database-diagram looks worthwhile, but haven't played with it.

Clone this wiki locally