我一直在尝试编辑 pg_hba.conf 文件,以便能够仅使用 IP 地址访问服务器,但到目前为止还没有成功。
例如,我可以使用«localhost»访问,但我想使用路由器给我的 IP 地址访问,例如 192.168.1.X
这是 mi pg_hba.conf:
# TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all trust
# IPv4 local connections:
host all all 127.0.0.1/32 trust
# IPv6 local connections:
host all all ::1/128 trust
# Allow replication connections from localhost, by a user with the
# replication privilege.
#local replication postgres trust
#host replication postgres 127.0.0.1/32 trust
#host replication postgres ::1/128 trust
host all all 0.0.0.0/0 trust
有什么帮助吗?