postgresql数据库错误FATAL: 28000: no pg_hba.conf entry for host "192.168.1.23", user "postgres", database

FATAL: 28000: no pg_hba.conf entry for host "192.168.1.23", user "postgres", database "sde", SSL off

问题出现原因:pg数据库和访问数据库的客户端不在同一台机子上,然后保存

我遇到的情况,pg装在了192.168.1.11上,访问pg的程序在192.168.1.23上,建立数据库连接的代码报错,内容如下:

FATAL: 28000: no pg_hba.conf entry for host "192.168.1.23", user "postgres", database "sde", SSL off

 

解决办法:

在pg的安装目录下,找到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.1.23/32 md5
# IPv6 local connections:
host all all ::1/128 md5
# Allow replication connections from localhost, by a user with the
# replication privilege.
————————————————


原文链接:https://blog.csdn.net/hellolib/article/details/89354433

posted @ 2021-11-11 10:21  溜溜球_小钢wan  阅读(1512)  评论(0)    收藏  举报