SchemaSpy Frequently Asked Questions
What do I need to run SchemaSpy?
Does SchemaSpy have a GUI?
The tool currently uses a command-line interface to generate a graphical representation of your database schema. Joachim Uhl has developed SchemaSpyGUI for those that aren't comfortable with command-line interfaces.
SchemaSpy doesn't detect any "real" relationships in my MySQL database but the relationships exist. Why?
One possible reason is that your database is using MySQL's MyISAM database engine, which doesn't enforce the concept of foreign key relationships...even if they're defined in the DDL. The typical alternative engine (that supports/enforces foreign key relationships) is InnoDB.
How do I analyze a subset of my schema?
The -i option lets you specify which tables/views to include in the analysis. It's a regular expression that must be grouped with ()'s and be separated by |'s.For example, using:
-i "(.*book.*)|(library.*)"includes only those tables/views with 'book' in their names or that start with 'library'.
You might want to use -desc with this option to describe the subset of tables.
How do I generate the output across several pages so I can put it up on a wall?
SchemaSpy uses the dot executable from Graphviz. By calling dot directly you can have it generate your output in multiple ways. For example:
dot -Gpage="8.5,11.0" -Gmargin="0,0" -Tps graphs/summary/relationships.real.large.dot -oprintableERD.ps
will generate postscript output that will span several 8.5" x 11" pages (i.e. for presentation on a wall).
I'm running SQLServer Express and get a "Failed to connect to database URL" exception. What do I do?
Chico San ran into this problem that he attributed to SQL Server Express using dynamic ports. His solution was to manually configure the server to listen on port 1433:
- Go into the SQL Server Configuration Manager
- open SQL SERVER 2005 Network Configuration
- open Protocols for SQLExpress
- open TCP/IP properties
- on the IP Addresses tab, In the TCP Dynamic Ports field set the value to 1433 (or any port value you want to use).