PostgreSQL服務端運行在Linux上,客戶端安裝在Windows上或linux上,使用navicat 連接不上,需要修改服務端配置
配置方法:
1. 修改服務端/etc/postgresql/9.3/main/postgresql.conf文件,將
#listen_address='localhost'改成
listen_address='*' (postgresql.conf這個文件改的是 去掉了#號 把localhost改成了*)
2. 修改/opt/postgresql/data/gp_hba.conf文件
在其中增加客戶端的ip,如下,注意最后一行:
# TYPE DATABASE USER CIDR-ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all trust
# IPv4 local connections:
host all all 127.0.0.1/32 trust
# IPv6 local connections:
host all all ::1/128 trust
# IPv4 local connections:
host all all 192.168.201.114/32 trust(或者改為host all all 0.0.0.0/0 trust,允許所有ip連接)
(gp_hba.conf這個文件改的是在最下面加了 上面這兩句話! )
3.重啟PG服務
[postgres@localhost data]$ /etc/init.d/postgresql restart
4. 現在使用客戶端連接就成功了