postgresql远程连接失败怎么解决-创新互联

创新互联www.cdcxhl.cn八线动态BGP香港云服务器提供商,新人活动买多久送多久,划算不套路!

创新互联建站专注于江川网站建设服务及定制,我们拥有丰富的企业做网站经验。 热诚为您提供江川营销型网站建设,江川网站制作、江川网页设计、江川网站官网定制、重庆小程序开发服务,打造江川网络公司原创品牌,更为您提供江川网站排名全网营销落地服务。

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

下载使用第三方软件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远程连接失败怎么解决-创新互联
当前路径:http://ybzwz.com/article/dchhdh.html