一、下載安裝完 postgresql 後,找到安裝目錄下的data文件夾sql
二、找到 pg_hba.conf文件,在文件最後有這樣一段數據庫
# IPv4 local connections:
host all all 127.0.0.1/32 md5post
host all all 192.168.40.0/24 md5字體
# IPv6 local connections:
host all all ::1/128 md5spa
三、在中間加入以上的紅色字體,192.168.40.0表示容許ip爲192.169.40.0-192.168.40-225的主機訪問postgresql
四、找到 postgresql.conf 文件 搜索 listen_addresses 關鍵字,找到以下行ip
listen_addresses = '*'md5
若是數據爲 #listen_addresses=‘localhost’則將#去掉,將localhost改成 *it
五、若是數據庫主機的ip爲 192.168.40.16 ,數據庫名爲 activiti ,那麼訪問地址爲io
jdbc:postgresql://192.168.40.16:5432/activiti
六、若是不行的話防火牆的對應端口要打開