Search Postgresql Archives

Cannot reach pg server using -h localhost

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

 



Hi,

>From the terminal in Mac OS X Yosemite, connecting to homebrew
installed 9.4.4, I have a problem if I specify the host (I know this
comes up all the time, bear with me as I have done a fair amount of
digging already). This works:

psql -Umyuser -d mydb
sql (9.3.5)
Type "help" for help.

myuser=#

Server log shows:

[unknown] LOG:  connection received: host=[local]
myuser [local]LOG:  connection authorized: user=myuser database=myuser

So that's all good. If I use -h it doesn't work:

psql -Umyuser -d mydb -h localhost
psql: server closed the connection unexpectedly
    This probably means the server terminated abnormally
    before or while processing the request.

Server log:

[unknown] LOG:  connection received: host=::1 port=51186
(... and that's it, no connection authorized line)

I've checked the normal things people suggest, e.g. postgresql.conf:

listen_addresses = 'localhost'     # also '*', '127.0.0.1', '::1'
port = 5432

and pg_hba.conf:

# IPv4 local connections:
host    all             all             127.0.0.1/32            trust
host    all             all             localhost                  trust
# IPv6 local connections:
host    all             all             ::1/128                     trust

And psql and pg_ctl are pointing to the same installations:

~ which psql
/usr/local/bin/psql
~ ll /usr/local/bin/psql
/usr/local/bin/psql -> ../Cellar/postgresql/9.4.4/bin/psql
~ which pg_ctl
/usr/local/bin/pg_ctl
~  ll /usr/local/bin/pg_ctl
/usr/local/bin/pg_ctl -> ../Cellar/postgresql/9.4.4/bin/pg_ctl

People have suggested checking for stuff on my machine that could
close connections. The Mac OS firewall is off and so is pf (Mac OS
packet filter).

This is all after upgrading (I had the same problem with 9.3.5) and
reinstalling.

Anyone got more clues for me?

Regards,
Fritz


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux