解决psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: No such file or directory Is the server running locally and accepting connections on that socket?

 pgsql启动后执行psql显示报错:

psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: No such file or directory
Is the server running locally and accepting connections on that socket?

 

只需要添加一条软连接:

ln -s /tmp/.s.PGSQL.5432 /var/run/postgresql/.s.PGSQL.5432

 

posted @ 2023-12-29 13:36  加鸡腿  阅读(7413)  评论(0)    收藏  举报