RELATEED CONSULTING
相关咨询
选择下列产品马上在线沟通
服务时间:8:30-17:00
你可能遇到了下面的问题
关闭右侧工具栏

新闻中心

这里有您想知道的互联网营销解决方案
postgresql远程连接失败怎么解决

小编给大家分享一下postgresql远程连接失败怎么解决,希望大家阅读完这篇文章后大所收获,下面让我们一起去探讨吧!

成都创新互联公司长期为上1000家客户提供的网站建设服务,团队从业经验10年,关注不同地域、不同群体,并针对不同对象提供差异化的产品和服务;打造开放共赢平台,与合作伙伴共同营造健康的互联网生态环境。为祁县企业提供专业的网站设计、做网站祁县网站改版等技术服务。拥有十多年丰富建站经验和众多成功案例,为您定制开发。

下载使用第三方软件Navicat for PostgreSQL管理postgresql。

推荐:PostgreSQL教程

连接时navicat报错:

could not connect to server:Connection refused (0x0000274D/10061)

解决方法:

1、关闭postgresql服务

[postgres@server2 data]$./pg_ctl -D /opt/pgsql/data -l logfile stop

2、修改配置文件/opt/pgsql/data/postgresql.conf

listen_addresses = ‘*’ # what IP address(es) to listen on;
# comma-separated list of addresses;
# defaults to ‘localhost’; use ‘*’ for all

注:不加引号pg无法启动

[postgres@server2 bin]$ ./postgres -D /opt/pgsql/data
LOG: syntax error in file “/opt/pgsql/data/postgresql.conf” line 60, near token “*”
FATAL: configuration file “/opt/pgsql/data/postgresql.conf” contains errors

3、修改pg_hba.conf

在该配置文件的ipv4配置后面的host all all 127.0.0.1/32 md5行下添加以下配置,或者直接将这一行修改为以下配置

host all all 0.0.0.0/0 trust

4、重启服务

[postgres@server2 data]$./pg_ctl -D /opt/pgsql/data -l logfile start

看完了这篇文章,相信你对postgresql远程连接失败怎么解决有了一定的了解,想了解更多相关知识,欢迎关注创新互联行业资讯频道,感谢各位的阅读!


网页标题:postgresql远程连接失败怎么解决
网站URL:http://scyingshan.cn/article/joeccs.html