我正在尝试通过 Capistrano 3 部署我的 Rails 应用程序。 在我自己的服务器上一切正常,但在我的新服务器上,我在访问数据库时遇到了一些问题:
DEBUG [05c115bf] FATAL: no pg_hba.conf entry for host "ip.address.of.the.server", user "postgres", database "my_database", SSL on
DEBUG [05c115bf] FATAL: no pg_hba.conf entry for host "ip.address.of.the.server", user "postgres", database "my_database", SSL off
我知道问题来自 pg_hba,但我找不到确切的位置。
这是我试过的:
# Database administrative login by Unix domain socket
local all postgres md5
# TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all peer
# IPv4 local connections:
host all all 127.0.0.1/32 md5
hostssl all all ip.address.of.the.server/24 md5
hostnossl all all ip.address.of.the.server/24 md5
# IPv6 local connections:
host all all ::1/128 md5
# Allow replication connections from localhost, by a user with the
# replication privilege.
#local replication postgres peer
#host replication postgres 127.0.0.1/32 md5
#host replication postgres ::1/128 md5
目前我被阻止了。
最佳答案
如果ip.address.of.the.server,请输入您要连接的服务器的真实 IP 地址以获取更多信息,请访问 pg_hba.conf
关于Postgresql 和主机,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23127199/