R
R
Rabinzon2015-11-11 11:59:07
PostgreSQL
Rabinzon, 2015-11-11 11:59:07

Why can't connect to psql?

Help me please.
pg_hba.conf

# TYPE  DATABASE        USER            ADDRESS                 METHOD

# "local" is for Unix domain socket connections only
local   all             all             0.0.0.0                 password
# IPv4 local connections:
host    all             all             0.0.0.0                 password
# IPv6 local connections:
host    all             all             ::1/128                 md5

$ sudo -i -u postgres 
$ psql
$ psql: could not connect to server: No such file or directory
  Is the server running locally and accepting
  connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
R
Rabinzon, 2015-11-13
@Rabinzon

I don't remember what changed. pg_hba.conf I now have this:
It is important not password but md5

A
Azazel PW, 2015-11-11
@azazelpw

netstat -tnlp Is
postgresql running?
if not, run
/etc/init.d/postgresql start
If it doesn't start there is a log
cat /var/lib/postgresql/pgstartup.log

A
Alexey Bulba, 2015-11-11
@Xserber

/var/run/postgresql/.s.PGSQL.5432 check for this file. The default can be 5433. To add 32 in the psql settings change the port.

S
Swartalf, 2015-11-11
@Swartalf

Check if a local socket (/var/run/postgresql/.s.PGSQL.5432) was created when running postges or if it has a different name. Also check the permissions on it.
Check in the config where and how this object should be created.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question