Postgres pg_hba.conf

raj*_*023 6 postgresql ruby-on-rails

我的一个客户端正在设置服务器,安装postgres后,当我们运行服务器时,我们遇到了以下错误.当我为它瞪眼时,有一些解决方案可用,但没有一个对我有用,你能不能看看它并说出发生了什么.

Status: 500 Internal Server Error
FATAL:  no pg_hba.conf entry for host "127.0.0.1", user "syr_admin", database     "allprosh_production", SSL off
Run Code Online (Sandbox Code Playgroud)

我的pg_hba.conf文件:

local all  all      md5
host samerole all  127.0.0.200   255.255.255.255   pam  pamservice=postgresql_cpses
host samerole all  127.0.0.1   255.255.255.255   md5
local all postgres        md5
host all postgres  127.0.0.1   255.255.255.255   md5
local   all     all     trust  
Run Code Online (Sandbox Code Playgroud)

提前致谢.

raj*_*023 7

我自己想通了,虽然花了很长时间.解决方案很简单,我只需要在pg_hba.conf文件中为该特定用户添加一个条目.这就是我做的:

local all syr_admin  md5
host all syr_admin 127.0.0.1   255.255.255.255   md5
Run Code Online (Sandbox Code Playgroud)

希望这有助于其他人...... :-)