Re: permission denied on socket

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Atul Kumar <akumar14871(at)gmail(dot)com>, pgsql-general <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: permission denied on socket
Date: 2024-01-25 20:32:25
Message-ID: e7811f7a-ef88-43e9-917f-9cf005e8202f@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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(dot)klaver(at)aklaver(dot)com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ron Johnson 2024-01-25 20:32:29 Re: permission denied on socket
Previous Message Ron Johnson 2024-01-25 20:24:32 Re: