当前位置:  开发笔记 > 编程语言 > 正文

SchemaSpy PostgreSQL - WARN - 连接失败

如何解决《SchemaSpyPostgreSQL-WARN-连接失败》经验,为你挑选了1个好方法。

我尝试使用SchemaSpy连接到我的PostgresSQL服务器.我安装使用Java oracle-java8-installerppa:webupd8team/java.

(我的PostgreSQL服务器在Docker容器上工作,所以我将端口转发到5431)

我的schemaspy.properties档案是:

# type of database. Run with -dbhelp for details
schemaspy.t=pgsql
# optional path to alternative jdbc drivers.
# database properties: host, port number, name user, password
schemaspy.host=localhost:5431
schemaspy.port=5431
schemaspy.db=dbname
schemaspy.u=dbuser
schemaspy.p=dbpassword
# output dir to save generated files
schemaspy.o=dbschema
# db scheme for which generate diagrams
schemaspy.s=public

当我运行此命令时:

java -jar schemaspy-6.0.0.jar -configFile schemaspy.properties

我确信数据库可以在lcoalhost:5431上访问.但我收到:

user@hostname:~/path-to-app$ java -jar schemaspy-6.0.0.jar -configFile schemaspy.properties 
  ____       _                          ____
 / ___|  ___| |__   ___ _ __ ___   __ _/ ___| _ __  _   _
 \___ \ / __| '_ \ / _ \ '_ ` _ \ / _` \___ \| '_ \| | | |
  ___) | (__| | | |  __/ | | | | | (_| |___) | |_) | |_| |
 |____/ \___|_| |_|\___|_| |_| |_|\__,_|____/| .__/ \__, |
                                             |_|    |___/

                                              6.0.0

SchemaSpy generates an HTML representation of a database schema's relationships.
SchemaSpy comes with ABSOLUTELY NO WARRANTY.
SchemaSpy is free software and can be redistributed under the conditions of LGPL version 3 or later.
http://www.gnu.org/licenses/

INFO  - Starting Main v6.0.0 on hostname with PID 18555 (/home/user/path-to-app/schemaspy-6.0.0.jar started by user in /home/user/path-to-app)
INFO  - The following profiles are active: default
INFO  - Found configuration file: schemaspy.properties
INFO  - Started Main in 3.406 seconds (JVM running for 4.519)
INFO  - Starting schema analysis
WARN  - Connection Failure

我应该添加驱动程序吗?我试过了postgresql-42.2.4.jar.我从jdbc.postgresql.org网站下载并将此行添加到配置文件中.

schemaspy.dp=postgresql-42.2.4.jar

但是它仍然显示相同的错误.



1> karwan..:

好的,我终于知道出了什么问题.schemaspy.dp=postgresql-42.2.4.jar应在定义数据库类型后直接添加此行.现在我的schemaspy.properties文件是:

# type of database. Run with -dbhelp for details
schemaspy.t=pgsql
# optional path to alternative jdbc drivers.
schemaspy.dp=postgresql-42.2.4.jar
# database properties: host, port number, name user, password
schemaspy.host=localhost:5431
schemaspy.port=5431
schemaspy.db=dbname
schemaspy.u=dbuser
schemaspy.p=dbpassword
# output dir to save generated files
schemaspy.o=/home/user/dump
# db scheme for which generate diagrams
schemaspy.s=public

并且工作正常.

推荐阅读
TXCWB_523
这个屌丝很懒,什么也没留下!
DevBox开发工具箱 | 专业的在线开发工具网站    京公网安备 11010802040832号  |  京ICP备19059560号-6
Copyright © 1998 - 2020 DevBox.CN. All Rights Reserved devBox.cn 开发工具箱 版权所有