psql:无法连接到服务器:没有这样的文件或目录“Centos7”

问题描述:

无法访问psql数据库。下面是错误,同时访问数据库:psql:无法连接到服务器:没有这样的文件或目录“Centos7”

psql: could not connect to server: No such file or directory 
    Is the server running locally and accepting 
    connections on Unix domain socket "/tmp/.s.PGSQL.5432"? 

我也试图寻找postmaster.pid但没有找到它

您的服务器已关闭,或者至少不是在您的psql命令认为它是。你可以在你的系统中搜索postgres.conf来告诉你它在哪个端口上,你可以尝试手动启动服务器。我会从查找conf文件开始。可能会在/ var/log内部进行日志记录,或者如果服务器出现问题而不是您不知道端口/数据库名称,您可以检查更多线索。

祝你好运

+0

谢谢卡尔文实际上有安装multipel psql版本,所以经过正确的调查解决了问题 – Guardian