pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Atul Kumar <akumar14871@gmail.com>
To: pgsql-general <pgsql-general@lists.postgresql.org>
Subject: Re: permission denied on socket
Date: Thu, 25 Jan 2024 12:32:25 -0800
Message-ID: <e7811f7a-ef88-43e9-917f-9cf005e8202f@aklaver.com> (raw)
In-Reply-To: <CA+ONtZ5Rmk4=EvXd0j17iN6O0WUhJDmEfK=WJavMsw5ygizfng@mail.gmail.com>
References: <CA+ONtZ5Rmk4=EvXd0j17iN6O0WUhJDmEfK=WJavMsw5ygizfng@mail.gmail.com>

On 1/25/24 12:22, Atul Kumar wrote:
> Hi,
> 
> I have postgres 13 running on centos 7.
> 
> I am facing an issue while trying to connect the cluster using the below 
> command.
> 
> -bash-4.2$ psql postgres
> 
> psql: error: connection to server on socket "/tmp/.s.PGSQL.5432" failed: 
> Permission denied

With the Postgres server running does:

/tmp/.s.PGSQL.5432

exist?

> 
> Is the server running locally and accepting connections on that socket?
> 
> 
> but when I am trying to connect using the below command I am able to 
> login to the cluster successfully.
> 
> -bash-4.2$ psql postgres -h localhost
> 
> postgres=#

The above works because you are not connecting to local(the socket), but 
to localhost(127.0.0.1 or ::1).

> 
> 
> I am not sure what is causing this issue and what needs to be done to 
> resolve it ?

Best guess is you are using a version of psql that is expecting the 
socket to be somewhere else then where it actually is.

> 
> 
> Regards.
> 
> 
> 

-- 
Adrian Klaver
adrian.klaver@aklaver.com






view thread (9+ messages)  latest in thread

Message-ID: <e7811f7a-ef88-43e9-917f-9cf005e8202f@aklaver.com>
Permalink:  ../e7811f7a-ef88-43e9-917f-9cf005e8202f@aklaver.com/
Also on:    postgresql.org/message-id/e7811f7a-ef88-43e9-917f-9cf005e8202f@aklaver.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: adrian.klaver@aklaver.com, akumar14871@gmail.com
  Subject: Re: permission denied on socket
  In-Reply-To: <e7811f7a-ef88-43e9-917f-9cf005e8202f@aklaver.com>
  References: <CA+ONtZ5Rmk4=EvXd0j17iN6O0WUhJDmEfK=WJavMsw5ygizfng@mail.gmail.com> <e7811f7a-ef88-43e9-917f-9cf005e8202f@aklaver.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox