博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
PostgreSQL 连接问题 FATAL: no pg_hba.conf entry for host
阅读量:6863 次
发布时间:2019-06-26

本文共 539 字,大约阅读时间需要 1 分钟。

The server doesn't grant access to the database: the server reports 

FATAL: no pg_hba.conf entry for host "192.168.0.123", user "postgres", database "postgres" FATAL: no pg_hba.conf entry for host "192.168.0.123", user "postgres", database "postgres"

 

PostgreSQL数据库为了安全,它不会监听除本地以外的所有连接请求,当用户通过JDBC访问是,会报一些如下的异常:

org.postgresql.util.PSQLException: FATAL: no pg_hba.conf entry for host

 

要解决这个问题,只需要在PostgreSQL数据库的安装目录下找到/data/pg_hba.conf,找到“# IPv4 local connections:”

在其下加上请求连接的机器IP

host all all 127.0.0.1/32 md5

32是子网掩码的网段;md5是密码验证方法,可以改为trust

转载地址:http://yoqyl.baihongyu.com/

你可能感兴趣的文章
2018/11/28 scp eve-ng
查看>>
使用Django操作数据库入门
查看>>
ny106 背包问题
查看>>
nyoj228 士兵杀敌(5)插线问线
查看>>
ny712 探寻宝藏 ny61 传纸条(1)
查看>>
CSS后代选择器可能的错误认识
查看>>
Python垃圾回收机制
查看>>
Gson将参数放入实体类中进行包装之后再传递
查看>>
设置mysql5.7远程连接-----------https://blog.csdn.net/qiyueqinglian/article/details/52778230
查看>>
IOS7状态栏StatusBar官方标准适配方法
查看>>
嵌入式开发之项目---uboot 内存合集
查看>>
模式识别之ocr项目---(模板匹配&BP神经网络训练)
查看>>
python3 geohash 导入错误及解决
查看>>
zabbix告警使用sendEmail
查看>>
CCF-NOIP-2018 提高组(复赛) 模拟试题(七)
查看>>
Java 基础知识点小结
查看>>
博弈入门
查看>>
iOS中获取当前时间,设定时间,并算出差值
查看>>
适配 移动 pc 拖拽效果
查看>>
a threadpool by python
查看>>