Answers for "psql: error: could not connect to server: could not connect to server: Connection refused"

4

could not connect to server: Connection refused Is the server running on host and accepting TCP/IP connections on port 5432?

cd /etc/postgresql/9.x/main/
------- open file named postgresql.conf
sudo nano postgresql.conf
------- add this line to that file
listen_addresses = '*'
------- then open file named pg_hba.conf
sudo nano pg_hba.conf
------- and add this line to that file
host  all  all 0.0.0.0/0 md5
------- restart your server
sudo /etc/init.d/postgresql restart
Posted by: Guest on May-28-2020
0

psql: error: could not connect to server: could not connect to server: no such file or directory

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"?
Posted by: Guest on March-24-2021

Code answers related to "psql: error: could not connect to server: could not connect to server: Connection refused"

Browse Popular Code Answers by Language