Wednesday, February 24, 2010

How to Enable Host Based Authentication in PostgreSQL

The PostgreSQL server by default works for localhost and you cannot connect to the server remotely or using ip address. To enable ip or remote connection you have to do the followings:
1. Open the file C:\Program Files\PostgreSQL\8.4\data\pg_hba.conf (Supposing Postgre to be installed in Program Files)
2. Find this text # IPv4 local connections:
3. Find this line "host all all 127.0.0.1/32 md5" line
4. Add this line after the Step 3 line:
host all all 192.168.10.0/24 md5
Supposing that you are the ip series: 192.168.10.x
if you are using 192.168.0.x then the entry might be :
host all all 192.168.0.0/24 md5
5. Reload the congifuration OR restart the server from Start->All Programs->PostgreSQL ->Restart Server

No comments: