A
A
Andropov242017-05-25 16:41:11
linux
Andropov24, 2017-05-25 16:41:11

Installing PostgreSQL. How to configure pg_hba.conf and postgresql.conf?

When I enter the command psql -U postgres
, I get the following output

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"?

I googled that the problem is in the posgresql and pg_hba configs. In the first, everything is by default, it listens to localhost, port 32. But with the second problem, I tried in different ways, but it does not work out. As a result, rolled it back to the default state.
local   all             postgres                                all

# TYPE  DATABASE        USER            ADDRESS                 METHOD

# "local" is for Unix domain socket connections only
local   all             all                                     trust
# IPv4 local connections:
host    all             all             127.0.0.1/32            trust
# IPv6 local connections:
host    all             all             ::1/128                 trust
# Allow replication connections from localhost, by a user with the
# replication privilege.
#local   replication     postgres                                trust
#host    replication     postgres        127.0.0.1/32            trust
#host    replication     postgres        ::1/128                 trust

Looking for wise advice

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Anton Shvets, 2017-05-25
@Andropov24

First of all, postgres does it work?
Secondly, remove or put in trust
There is no such type of authorization all
https://postgrespro.ru/docs/postgrespro/9.6/auth-p...

X
x67, 2017-05-25
@x67

If it listens to a non-standard port, then you need to connect like this
. Try to also comment out everything, leaving
and gradually add on the line that makes sense.
Well, after each change of settings, do not forgetservice postgresql restart

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question