PostgreSQL remote connection

Following  enable postgresql server remote connection:

1. Enable TCP connection.
   open /usr/local/pgsql/data/postgresql.conf
   ensure listen_addresses = '*' and port = 5432, so we can config it like:
   listen_addresses = '*'
   port = 5432
   max_connections = 100
   
2. Add client hosts which allowed to connect.
   open /usr/local/pgsql/data/pg_hba.conf
   add lines which contain the client hosts information in IPv4 local connections section.
   e.g. one client host that ip is 192.168.1.110 want to connect to postgresql server, we can do it like this:
   # IPv4 local connections:
   host      all         all            192.168.1.110         trust

3. Make sure the firewall of the server enable the port of 5432 (it's very important)

Best wishes!

posted @ 2007-05-21 08:33  vsignsoft  阅读(586)  评论(0编辑  收藏  举报