psql连接报错 .s.PGSQL.5432

2024-04-02
-
-
psql: error: connection to server on socket "/var/pgsql/data/.s.PGSQL.5432" failed: No such file or directory
       Is the server running locally and accepting connections on that socket?

问题分析:

[postgres@localhost ~]$ cat /opt/postgresql/pgdata/postgresql.conf | grep unix_socket_directories
#unix_socket_directories = '/tmp'       # comma-separated list of directories

解决方式:修改/opt/postgresql/pgdata/postgresql.conf文件中的unix_socket_directories参数

unix_socket_directories='/var/postgresql/pgdata'   # 修改成自己的 pgsql 数据文件目录

# 重启服务
pg_ctl restart

“您的支持是我持续分享的动力”

微信收款码
微信
支付宝收款码
支付宝

黄金_shmaur
不积跬步,无以至千里;不积小流,无以成江海
目录关闭