Reputation: 1296
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:
ln -s /tmp/.s.PGSQL.5432 /var/run/postgresql/.s.PGSQL.5432
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.
Upvotes: 1
Views: 2541
Reputation: 1296
The problem is solved. I reinstall postgresql and during installing process run 'pg_ctlcluster 11 main start'
Upvotes: 0