localhost
连接,使用ip
连接报错问题?data
文件夹下找到pg_hba.conf
修改地址访问配置 # TYPE DATABASE USER ADDRESS METHOD
# IPv4 local connections:
host all all 127.0.0.1/32 md5
host all all 192.168.0.0/0 md5
# IPv6 local connections:
host all all ::1/128 md5
host all all 192.168.0.0/0 md5
# Allow replication connections from localhost, by a user with the
# replication privilege.
#host replication postgres 127.0.0.1/32 md5
#host replication postgres ::1/128 md5
host all all 192.168.0.0/0 md5
在IPv6
处添加
host all all 192.168.0.0/0 md5
services.msc
找到数据库服务重启即可