【问题标题】:psql: could not connect to server: No such file or directory "Centos7"psql:无法连接到服务器:没有这样的文件或目录“Centos7”
【发布时间】:2018-01-14 01:35:29
【问题描述】:

无法访问 psql 数据库。以下是访问数据库时的错误:

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 但没有找到

【问题讨论】:

    标签: linux database postgresql psql


    【解决方案1】:

    您的服务器已关闭或至少不在您的 psql 命令认为的位置。您可以在系统中搜索 postgres.conf,它应该会告诉您它在哪个端口上,您可以尝试手动启动服务器。我将从寻找 conf 文件开始。 /var/log 内可能有日志记录,如果服务器出现问题而不是您不知道端口/dbname,您可以检查以获取更多线索。

    祝你好运

    【讨论】:

    • 感谢 calvin 实际上安装了多个 psql 版本,因此在查看正确的版本后解决了问题
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-04-08
    • 2017-11-29
    • 2015-12-24
    相关资源
    最近更新 更多