新聞中心
這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
postgresql遠程連接失敗怎么解決-創(chuàng)新互聯(lián)
創(chuàng)新互聯(lián)www.cdcxhl.cn八線動態(tài)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遠程連接失敗怎么解決有了一定的了解,想了解更多相關知識,歡迎關注創(chuàng)新互聯(lián)-成都網(wǎng)站建設公司行業(yè)資訊頻道,感謝各位的閱讀!
名稱欄目:postgresql遠程連接失敗怎么解決-創(chuàng)新互聯(lián)
路徑分享:http://www.dlmjj.cn/article/dchhdh.html