1

Linux Mint. PostgreSQL 11.

I'am trying: psql -U postgres

And receive:

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"

In postgresql.conf:

   listen_addresses = '*'
   unix_socket_directories = '/var/run/postgresql'
   unix_socket_permissions = 0777

After ps axf | grep postgres:

6575 ?        Sl     0:01          |       |   \_ xed /etc/postgresql/11/main/postgresql.conf

4906 pts/0    S      0:00          \_ sudo su postgres
4907 pts/0    S      0:00              \_ su postgres
6586 pts/0    S+     0:00                                      \_ grep --color=auto postgres

But

  root@andrej-HP-290-G1-SFF-Business-PC:/etc/postgresql/11/main# netstat -nltp | grep 5432
  root@andrej-HP-290-G1-SFF-Business-PC:/etc/postgresql/11/main# 

How I tried to treat this problem:

  1. ln -s /tmp/.s.PGSQL.5432 /var/run/postgresql/.s.PGSQL.5432

  2. sudo find /tmp/ -name .s.PGSQL.5432

    Result: /tmp/.s.PGSQL.5432. And try under su: psql -U postgres

Running 'pg_lsclusters', I see:

11  main    5432 down   postgres /var/lib/postgresql/11/main /var/log/postgresql/postgresql-11-main.log

So, status is down. But when I try 'pg_ctlcluster 11 main start' I receive:

Job for [email protected] failed because the service did not 
take the steps required by its unit configuration.
See "systemctl status [email protected]" and "journalctl -xe" 
for details.

Executing "journalctl -xe":

 failed to create Unix-сокет in "/tmp
 system bd is switched-off
 failde to start server
  Can't open PID file /run/postgresql/11-main.pid (yet?) after start: 
  No such file or dir
  Failed with result 'protocol'.
  Failed to start PostgreSQL Cluster 11-main.
2
  • 1
    check this link maybe it will help you. stackoverflow.com/questions/31645550/… Commented Jan 23, 2020 at 10:36
  • Using this link, after entering "pg_lsclusters" I found, that status is down Commented Jan 23, 2020 at 10:44

1 Answer 1

0

The problem is solved. I reinstall postgresql and during installing process run 'pg_ctlcluster 11 main start'

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.