Re: Can't connect to 7.4 DB

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



OK, here's a little trick you may not be aware of.

pg_connect("dbname=mydb user=stan");

will open a local unix domain socket.

pg_connect("host=127.0.0.1 dbname=mydb user=stan");

will open a local TCP/IP connection on the loopback interface.

In order for this to work, your postgresql.conf must have this line 
changed:
#tcpip_socket = false
to
tcpip_socket = true

and your pg_hba.conf needs a line like this:

host    all         all         127.0.0.1         255.0.0.0   trust

So it's likely the "secure by default" mentality of postgresql that's 
biting you here.



[Index of Archives]     [Postgresql General]     [Postgresql Admin]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Yosemite Backpacking]     [Postgresql Jobs]

  Powered by Linux