PDA

View Full Version : pg_hba.conf not saving changes?



brainfry35
12-19-2010, 12:28 PM
I'm looking to connect to my postgres db from my local network and when i add lines to the pg_hba.conf file it doesnt save it. I add the line press save and reopen the file to verify and its not there.

I'm following these instructions:

Change the pg_hba.conf file likewise. Choose File/Open pg_hba.conf (file can be found in PostgreSQL/8.3/data directory).

Add a line like in the picture by double clicking in the square in the new line

pgadmin-03.jpg

Add a line like host/all/postgres/0.0.0.0/md5 if you want to access your database from the internet (See also additional steps for Internet access)

Or add a line like host/all/postgres/192.168.2.3 (= Ip-adres laptop)/md5 if you only want to access your database from inside your local network with your laptop/ second computer.

Or add a line like host/all/postgres/192.168.2.0 (= address of your local network)/md5 if your laptop is getting an IP Adres from a DHCP server within your network.

Or add a line like host/all/192.168.2.3/trust if you do not want have anything to do with passwords.

netsrak
12-19-2010, 12:43 PM
Copy the file to your desktop. Open the copied file in the editor (you need administrator rights). Save the changes. Now rename the original file as backup copy and move the changed file from the desktop to the original folder and restart the postgresql service.

brainfry35
12-19-2010, 01:13 PM
Ok it looks like it doesnt get save when u manually edit the file without a port.

When I add a port it seems to save correctly.

Does that look right to you?

# TYPE DATABASE USER CIDR-ADDRESS METHOD

# IPv4 local connections:
host all all 127.0.0.1/32 md5
host all all 192.168.1.1/5432 md5
# IPv6 local connections:
host all all ::1/128 md5
host all all 0.0.0.0 md5

morny
12-19-2010, 11:37 PM
Yeah that looks fine