7

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 uninstalled and installed postgresql but nothing works for me.

$ sudo service postgresql start
 * Starting PostgreSQL 10 database server                                                                                                       
 * Failed to issue method call: Unit [email protected] failed to load: No such file or directory. See system logs and 'systemctl status [email protected]' for details.

systemctl status postgresql 
Failed to issue method call: No such interface 'org.freedesktop.DBus.Properties' on object at path /org/freedesktop/systemd1/unit/postgresql_2eservice

$ psql -V
psql (PostgreSQL) 10.4 (Ubuntu 10.4-2.pgdg14.04+1)
6
  • Make sure you add your server to your PostgreSQL\9.4\data\pg_hba.conf file Commented Jul 23, 2018 at 13:33
  • What was the issue, did u solve it. I have exacly the same problem Commented Oct 16, 2018 at 12:48
  • I am facing the same issue. Does anybody know the answer? Commented Oct 26, 2018 at 14:09
  • Is it a new installation or an upgrade? Is this on linux? I also advise to move the question to dba.stackexchange.com since the question is not related to programming. Commented Oct 28, 2018 at 9:30
  • @Salini I answered the question. Commented Oct 31, 2018 at 15:11

1 Answer 1

2

This problem /var/run/postgresql/.s.PGSQL.5432 is about permission,

did you change the database directory? if yes so you need to give write and read permission to the postgres

sudo chown -R postgres:postgres <directory_path>

or

sudo chmod -R 777 <directory_path>

case you cannot use remote access, on pg_config edit this line listen_addresses = 'localhost' to listen_addresses = '*'

and in the pg_hba.conf insert this line:

host    all  all  0.0.0.0/0  md5
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.