2017-04-14 60 views
0

我想使用我的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 

有反正我可以解決這個問題嗎?

回答

0

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

+0

好的謝謝。非常感激。 –