Schemacrawler的Kerberos PostgresDB
问题描述:
我想使用我的Kerberos凭据访问Postgres数据库,所以我不必使用密码,但Schemacrawler要求输入密码并提供以下错误。Schemacrawler的Kerberos PostgresDB
SchemaCrawler 14.15.04
Error: Could not connect to jdbc:postgresql://nhc-contracts-db-dev.nicc.noblis.org:5432/networx?ApplicationName=SchemaCrawler;loggerLevel=DEBUG, for user 'phayes', with properties {}
Re-run SchemaCrawler with just the
-?
option for help
Or, re-run SchemaCrawler with an additional
-loglevel=CONFIG
option for details on the error
Apr 14, 2017 10:43:29 AM us.fatehi.commandlineparser.CommandLineUtility logSafeArguments
INFO: SchemaCrawler, v14.15.04
Apr 14, 2017 10:43:29 AM us.fatehi.commandlineparser.CommandLineUtility logSafeArguments
INFO: Command line:
-server=postgresql
-host=nhc-contracts-db-dev.nicc.noblis.org
-port=5432
-database=networx
-schemas=public
-user=phayes
-password=*****
-infolevel=standard
-command=schema
-loglevel=CONFIG
Apr 14, 2017 10:43:29 AM us.fatehi.commandlineparser.CommandLineUtility logFullStackTrace
SEVERE: Could not connect to jdbc:postgresql://nhc-contracts-db-dev.nicc.noblis.org:5432/networx?ApplicationName=SchemaCrawler;loggerLevel=DEBUG, for user 'phayes', with properties {}
schemacrawler.schemacrawler.SchemaCrawlerSQLException: Could not connect to jdbc:postgresql://nhc-contracts-db-dev.nicc.noblis.org:5432/networx?ApplicationName=SchemaCrawler;loggerLevel=DEBUG, for user 'phayes', with properties {}
at schemacrawler.schemacrawler.BaseDatabaseConnectionOptions.getConnection(BaseDatabaseConnectionOptions.java:183)
at schemacrawler.schemacrawler.BaseDatabaseConnectionOptions.getConnection(BaseDatabaseConnectionOptions.java:102)
at schemacrawler.tools.commandline.SchemaCrawlerCommandLine.execute(SchemaCrawlerCommandLine.java:127)
at schemacrawler.Main.main(Main.java:90)
Caused by: org.postgresql.util.PSQLException: GSS Authentication failed
at org.postgresql.gss.MakeGSS.authenticate(MakeGSS.java:66)
at org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(ConnectionFactoryImpl.java:594)
at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:222)
at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:49)
at org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:194)
at org.postgresql.Driver.makeConnection(Driver.java:431)
at org.postgresql.Driver.connect(Driver.java:247)
at schemacrawler.schemacrawler.BaseDatabaseConnectionOptions.getConnection(BaseDatabaseConnectionOptions.java:161)
... 3 more
Caused by: javax.security.auth.login.LoginException: No LoginModules configured for pgjdbc
at javax.security.auth.login.LoginContext.init(Unknown Source)
at javax.security.auth.login.LoginContext.<init>(Unknown Source)
at org.postgresql.gss.MakeGSS.authenticate(MakeGSS.java:56)
... 10 more
有反正我可以解决这个问题吗?
答
SchemaCrawler允许使用JDBC数据库连接URL字符串进行连接的备用方式。请参考与"Connecting to the Database"有关的PostgreSQL文档来构造适当的URL字符串。
然后,而不是主机和端口,使用URL而不是像下面的例子。如果您不打算或不需要使用密码,请确保您提供一个空密码-password=
。在SchemaCrawler命令行的
示例代码片段: -server=postgresql -url=<appropriate url here> -database=networx -schemas=public -user=phayes -password= -infolevel=standard -command=schema
Sualeh Fatehi,SchemaCrawler
好的谢谢。非常感激。 –