赞
踩
postgres远程连接方式配置
配置pg_hba.conf文件 目录C:Program FilesPostgreSQL9.5data
(QXY)主机
[postgres@qxy data]$ pwd
/spark/pgsql/data
[postgres@qxy data]$ cat 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
在# IPv4 local connections:
下面添加一行,内容为 “host all all 192.168.40.1/24 md5”,代表192.168.40网段的IP地址的所有用户都可以连接,/24代表网段,如果是/32 需要写完整的IP地址
添加之后的内容如下:
# “local” is for Unix domain socket connections only
local all all trust
# IPv4 local connections:
host all all 127.0.0.1/32 trust
host all all 192.168.40.1/24 md5
2. 修改postgres监听的IP地址,默认是localhost ---------- 有时候默认就是O
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。