当尝试从我的项目连接到我的 AWS RDS 数据库时,我收到此错误:
error: no pg_hba.conf entry for host "xx.xx.xx.xx", user "myUser", database "myDatabase", no encryption
postgresql.conf:
listen_addresses = '*'
pg_hba.conf:
local all all scram-sha-256
host all all 127.0.0.1/32 scram-sha-256
host all all ::1/128 scram-sha-256
local replication all scram-sha-256
host replication all 127.0.0.1/32 scram-sha-256
host replication all ::1/128 scram-sha-256
我的凭证适用于 pgadmin4 和 psql,并且我能够正常连接到该项目中的不同 AWS RDS 数据库。我缺少什么和/或我应该尝试什么才能连接到我的数据库。
原来是我的 ssl 证书有问题,因为我没有正确提供它。据推测,这就是提到错误消息的原因
no encryption
,因为所有条目都在pg_hba.conf
预期中scram-sha-256
,但什么也没收到。扩展一下,上面的错误消息似乎是一条通用消息,旨在防止尝试访问您的端点的随机人员获得太多洞察力。