无法连接到PostgreSQL服务器:无法连接到服务器:权限被拒绝 [英] Unable to connect to PostgreSQL server: could not connect to server: Permission denied

查看:990
本文介绍了无法连接到PostgreSQL服务器:无法连接到服务器:权限被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

警告:pg_connect():无法连接到PostgreSQL服务器:无法连接到服务器:权限被拒绝服务器是否在主机"10.0.1.201"上运行并接受端口5432上的TCP/IP连接?

Warning: pg_connect(): Unable to connect to PostgreSQL server: could not connect to server: Permission denied Is the server running on host "10.0.1.201" and accepting TCP/IP connections on port 5432?

这是我尝试从基于linux的服务器连接到远程数据库时遇到的错误

This is the error i am getting when trying to connect to remote database from linux based server

尽管我能够从本地主机连接到它

Though i am able to connect to it from localhost

有人可以帮我吗

推荐答案

另一个适用于我的可能的方案/解决方案(针对同一问题)在这里:

One more possible scenario/solution that worked for me (for the very same problem) is here:

service httpd stop
service postgresql stop

setsebool -P httpd_can_network_connect 1

service httpd start
service postgresql start

这篇关于无法连接到PostgreSQL服务器:无法连接到服务器:权限被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆