在我的本地服务器(Ubuntu 14.04)上一切正常。但是在测试服务器(Centos)上,我无法从PHP(Yii 1.1)连接到我的数据库。 在两台服务器上,我使用了相同的转储,用户名,密码,postgres和php代码版本。
在本地服务器apache上。在测试nginx。
CDbConnection无法打开数据库连接:SQLSTATE [08006] [7] 致命:对于用户" tripinsu"
,身份验证失败
的pg_hba.conf:
local all all md5
host all all 127.0.0.1/32 ident
host all all ::1/128 ident
答案 0 :(得分:1)
local all postgres peer
local all all md5
host all all 127.0.0.1/32 md5
host all all ::1/128 md5
我希望这有助于其他人