Schemaspy is an open source database document generation tool developed by Java. For complex database structures, the corresponding relationships given to individual entities can be visually displayed, which is of great help to understand the structure of the database.
Official website: http://schemaspy.org Github address: https://github.com/schemaspy/schemaspy
I have packaged the packages I used and sent to the download area of csdn.
The environment I'm using:
Operating system: Ubuntu 16.04 64-bit database: postgreSQL SchemaSpy is developed for Java, so you must first install Java if you want to run it. I am using ubuntu 16.04 , and the method to install java8 is as follows:
After installation, use java -version to check whether the installation is successful.
graphviz is a simple command-line tool for drawing flow charts. schemaspy uses this tool to draw the relationship between each table.
The final effect is shown in the figure below:
If you are under ubuntu, use it directly
sudo apt-get install graphviz After installation, add environment variables to ~/.bashrc .
Just download the jar package directly from the official Github.
I have uploaded to the CSDN download area, address is: http://download.csdn.net/detail/liuyueyi1995/9768678
Download according to the database and Java version used. https://jdbc.postgresql.org/download.html I am using postgreSQL + java8, and the corresponding download PostgreSQL JDBC 4.2 Driver, 42.0.0 is enough.
I have uploaded to the CSDN download area, address is: http://download.csdn.net/detail/liuyueyi1995/9768679
Just execute the following command
java -jar schemaspy.jar -t dbType -dp driver -db dbName -host hostname -port port port -s schema -u user -p password -o outputDir| parameter | explain |
|---|---|
-jar | Specify the path to schemaspy.jar storage |
-t | Indicate the database type, use java -jar schemaspy -dbhelp to see how to write those databases and their corresponding parameters. |
-dp | Indicate the path of the jdbc driver storage |
-db | Specify the database name |
-host | Specify the IP of the database server |
-port | Specify the corresponding port of the database service |
-s | Indicate the schema |
-u | Specify the username |
-p | Indicate the login password |
-o | Specify the storage location of the result, and the result is displayed in the form of a web page |
The directory structure is shown in the figure below:
Open it on the web page to see the analysis results: