Postgresql server remote connection

隐身守侯 提交于 2019-12-05 14:38:40

Your pg_hba.conf should NOT use trust!!! trust means no password is required and I don't think that's what you want.

This is the correct configuration

host    all             all             0.0.0.0/0               md5

Notice the /0 behind 0.0.0.0.

The full pg_hba.conf should be this:-

local   all             all                                     trust
# IPv4 local connections:
host    all             all             127.0.0.1/32            md5
# IPv6 local connections:
host    all             all             ::1/128                 md5
host    all             all             0.0.0.0/0               md5

Notice that trust is only applicable for local connections. i.e. for applications running on localhost IP 127.0.0.1 on the machine which also runs your postgresql server.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!