我正在尝试从运行ubuntu的AWS服务器连接到托管的postgesql数据库。但是,我一直收到错误:
error: no pg_hba.conf entry for host "xx.xx.xx.xx", user "db_user", database "db_name", SSL off
所以我修改了我的pg_hba.conf
文件(请注意标记为new entry
的行:
# Database administrative login by Unix domain socket
local all postgres peer
# 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
host db_name db_user xx.xx.xx.xx md5 (new entry)
host all all all md5 (new entry)
#IPv6 local connections:
host all all ::1/128 md5
然后我重新启动了postgresql并重试连接 有谁知道我可能做错了什么?
答案 0 :(得分:0)
尝试替换
这样:
for
到那个:
host db_name db_user xx.xx.xx.xx md5 (new entry)
或
host db_name db_user all md5 (new entry)