psql: could not connect to server: Permission denied
psql: could not connect to server: Permission denied
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
This is due to PostgreSQL service unable to create .s.PGSQL.5432 file in /tmp because of insufficient permission.
You can also follow other topic:
Temporary Solution:
# chmod -R 777 /tmp/
Once done psql command will start work, but after reboot it will stop working.
# su - postgres
$ psql
psql (11.4)
Type "help" for help.
postgres=#
Permanent Solution:
# find / -name postgresql.conf
# vi /usr/local/pgsql/data/postgresql.conf
Change permission for below parameter
unix_socket_permissions = 0777
or comment below parameter in postgresql.conf
# unix_socket_permissions = 0
# service postgres stop
# service postgres start
Check if working or not
# su - postgres
$ psql
psql (11.4)
Type "help" for help.
postgres=#
You can also follow other topic:
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
This is due to PostgreSQL service unable to create .s.PGSQL.5432 file in /tmp because of insufficient permission.
You can also follow other topic:
# chmod -R 777 /tmp/
Once done psql command will start work, but after reboot it will stop working.
# su - postgres
$ psql
psql (11.4)
Type "help" for help.
postgres=#
Permanent Solution:
# find / -name postgresql.conf
# vi /usr/local/pgsql/data/postgresql.conf
Change permission for below parameter
unix_socket_permissions = 0777
or comment below parameter in postgresql.conf
# unix_socket_permissions = 0
# service postgres stop
# service postgres start
Check if working or not
# su - postgres
$ psql
psql (11.4)
Type "help" for help.
postgres=#
You can also follow other topic:
Comments
Post a Comment