2013-11-25 120 views
0

當我試圖連接到postgresql數據庫時,我總是收到一個驗證錯誤。這裏是具體的錯誤:連接到postgresql數據庫

[error] c.j.b.h.AbstractConnectionHook - Failed to obtain initial connection Sleeping for 0ms and trying again. Attempts left: 0. Exception: null.Message:FATAL: password authentication failed for user 

我已經檢查和雙重檢查用戶名和密碼,所以這不是問題。我能夠使用psql成功連接到這個完全相同的數據庫。這裏是我的application.conf看起來像

# Database configuration 
# ~~~~~ 
# You can declare as many datasources as you want. 
# By convention, the default datasource is named `default` 
# 
# db.default.driver=org.h2.Driver 
# db.default.url="jdbc:h2:mem:play" 
# db.default.user=sa 
# db.default.password="" 
#Database configuration using PostgreSQL database engine 
db.default.driver=org.postgresql.Driver 
db.default.url="jdbc:postgresql://website.com/database" 
db.default.user="username" 
db.default.password="password") 

# Evolutions 
# ~~~~~ 
# You can disable evolutions if needed 
# evolutionplugin=disabled 

# Logger 
# ~~~~~ 
# You can also configure logback (http://logback.qos.ch/), 
# by providing an application-logger.xml file in the conf directory. 

# Root logger: 
logger.root=ERROR 

# Logger used by the framework: 
logger.play=INFO 

# Logger provided to your application: 
logger.application=DEBUG 

                68,0-1  Bot 

感謝您的洞察力!

+0

推測:pwd中正在使用的任何特殊字符? –

+0

它完全是字母數字 –

+0

抱歉未能完全閱讀該問題。初始評論無效 – Gavin

回答

1
db.default.password="password") 

的)是一個打字錯誤? 如果不是,請將其刪除並重試。

+0

有時你只需要擔心自己的智力,非常感謝你,這就是問題所在:) –

0
db.default.driver="org.postgresql.Driver" 
db.default.url="postgres://username:[email protected]:5432/mydb" 

這工作對我很好,我也不事件中使用db.default.userdb.default.password