psql : could not connect to server: - postgresql

I recently installed ubuntu and downloaded postgres from brew, but when trying to get into psql I get this error:
psql: error: could not connect to server: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
I have tried alternative varias and without success, could anyone help

Related

PostgreSQL: could not connect to server

I have an issue that I've been trying to fix but after reading articles, I couldn't do anything about it. The problem is as it follows:
I just installed Apache, php and MySQL on a VPS. Then I had to install PostgreSQL and set up a database and a new user. After running the psql command, I got 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"?
So, my question is how do I fix this. I'd be grateful if I receive some feedback.

Postgres connection error in ubuntu and centos

I am new to postgres. While connecting through ubuntu and centos I'm getting this error:
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"?
Give permission to all host by editing ipv4 entry in pg_hba.conf file.
After modification restart postgresql service.

Not able to connect to postgres on aws ubuntu

When I run python3 manage.py makemigrations.
It throws the following error.
File "/usr/local/lib/python3.5/dist-packages/psycopg2/init.py", line 164, in connect
conn = _connect(dsn, connection_factory=connection_factory, async=async)
django.db.utils.OperationalError: could not connect to server: Connection refused
Is the server running on host "localhost" (127.0.0.1) and accepting
TCP/IP connections on port 5432?
So I had checked whether postgres is working fine
I had tried sudo su - postgres
It went inside the postgres cmd prompt so it became
postgres#ip-10-254-3-58:~$
now when I try psql I get the same error as when I run python3 manage.py makemigrations.
postgres#ip-10-254-3-58:~$psql
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"?
Please help me in fixing this issue.
TIA
Kind Regards,
Bharath AK

SSL on postgresql FATAL ERROR

I'm currently working on ubuntu 16.04. When I make ssl configurations for postgresql and then restart the service with this command:
/etc/init.d/postgresql restart
My database starts refusing the connections
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"?
How can I fix this?

GPDB-psql: could not connect to server: No such file or directory

We have the small array of Greenplum database.In that, We have a master node. when I am trying to use PSQL utility
Getting this error :
[gpadmin#master gpseg-1]$ psql
PSQL: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
We tried
on searching for postmaster.pid files.We have removed it.But still, the error remains.
You need to export your PGPORT and source Postgres.sh_path(inside your GPDB).
After that you will be able to do psql and connect to the database.