栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

postgresql客户端不能访问解决方法

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

postgresql客户端不能访问解决方法

做程序调用postgresql数据库的时候,后台出现这么一条错误: 

java.sql.SQLException: No pg_hba.conf entry for host 210.230.203.160, user postgres, database rinri01 

这条错误是什么意思?为什么会出现呢? 

这条错误的原因是因为客户端远程访问postgresql受限所致,因为postgresql默认情况下除本机外的机器是不能连接的。

解决方法:

修改pg_hba.conf,增加需要访问的客户端IP,具体示例如下:

路径:D:Program FilesPostgreSQL9.2data

# IPv4 local connections:
host    all             all             127.0.0.1/32            md5
host    all             all             200.200.203.0/24        md5
host    all             all             200.200.202.0/24        md5
host    all             all             172.16.101.0/24         md5
host    all             all             172.16.201.0/24         md5
host    all             all             172.16.14.0/24         md5
host    all             all             172.16.206.0/24         md5

推荐:PostgreSQL教程

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/816517.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号