* SchemaSpy is a Java-based tool (requires Java 5 or higher) that analyzes the metadata of a schema in a database and generates a visual representation of it in a browser-displayable format. It lets you click through the hierarchy of database tables via child and parent table relationships as represented by both HTML links and entity-relationship diagrams. It’s also designed to help resolve the obtuse errors that a database sometimes gives related to failures due to constraints.
* It is free software that is distributed under the terms of the Lesser GNU Public License 2.1.
* Install Graphviz by running following command in terminal(Alt+Ctrl+T):
sudo apt-get install graphviz
* SchemaSpy uses the dot executable from Graphviz to generate graphical representations of the table/view relationships.
* Run the following command in terminal:
sudo apt-get install libmysql-java
* After thet download the SchemaSpy Software from the following link:
* Rename the downloaded package to your suitable name (say SchemaSpy).
* Now run the SchemaSpy with the following given command.Make appropriate changes in below command before running, like :
java -jar schemaSpy.jar -t mysql -o library -host localhost -db db_name -u user -p password -dp /usr/share/java/mysql-connector-java.jar
Description of parameters used in above command:
-t databaseType: Type of Database(e.g ora,db2 etc.)
-db db_name: Name of the Database to connect to.
-u user: Valid database user id with read access.
-s schema: Database schema.
-p password: Password associated with that user.
-o output Directory: Directory to write the generated HTML/graphs to.
-dp path/T/oDrivers: Looks for drivers here before looking in driverPath in [databaseType].properties. The drivers are usually contained in .jar or .zip files and are typically provided by your database vendor.
* Your Library folder has been created in /home/downloads , open the library folder and you can run any of the files in browser and understand relationships among different tables in database.
Note: In some cases, it gives following error after running the above command :
The program ‘java’ can be found in the following packages:
Try: sudo apt-get install <selected package>
* Run following commands to satisfy all the needs :
apt-cache search jdk
sudo apt-get install openjdk-7-jdk openjdk-7-jre
* Now again run the SchemaSpy with the above given command.It wll work.
Thats all 🙂