连接postgresql出错no pg_hba.conf entry for host “**”,user “postgres“,database “postgres“,no encryption
连接postgresql出错no pg_hba.conf entry for host “**”,user "postgres",database "postgres",no encryption
·
1.环境信息
虚拟机软件:Oracle VM VirtualBox 7.0
操作系统:CentOS Linux release 8.5.2111
远程终端工具:MobaXterm_Personal_24.0
postgresql版本:psql (PostgreSQL) 16.4
数据库客户端:heidisql 12.8.0.6908(64 Bit)
2.出现问题
连接postgresql出错no pg_hba.conf entry for host “**”,user "postgres",database "postgres",no encryption
3.处理解决问题
3.1通过命令查找配置文件
find / -name pg_hba.conf 查找到配置文件,
我安装的是16路径为:/var/lib/pgsql/16/data/pg_hba.conf
3.2进行配置文件添加允许访问
vi /var/lib/pgsql/16/data/pg_hba.conf
添加 一行ip段开放访问(按实际提示错误填写),如下形式。
3.3重启postgresql服务端
systemctl restart postgresql-16.service
不清楚服务名的可通过 cd /usr/lib/systemd/system && ls | grep post 查找
3.4 最终访问正常
更多推荐
所有评论(0)