【问题标题】:Cannot access database through psql after upgrading to 10.3升级到10.3后无法通过psql访问数据库
【发布时间】:2018-09-08 21:02:18
【问题描述】:

我刚刚通过 Homebrew 升级到 Postgres 10.3。我似乎无法通过“psql [数据库名称]”登录我的数据库。

我收到以下错误:

psql:无法连接到服务器:没有这样的文件或目录服务器是否在本地运行并接受 Unix 域套接字“/tmp/.s.PGSQL.5432”上的连接?

此外,尝试通过 HomeBrew 运行重新启动(“brew services restart postgresql”)没有问题。下面是输出。

停止postgresql...(可能需要一段时间)

==> 成功停止postgresql(标签:homebrew.mxcl.postgresql)

==> 成功启动postgresql(标签:homebrew.mxcl.postgresql)

还运行了“ps auxw | grep post”,但这没有产生任何输出。

【问题讨论】:

    标签: postgresql homebrew psql


    【解决方案1】:

    在以下位置 /usr/local/var/postgres 删除 postmaster.pid 有效。此外,看到这里引用的同一问题的相同答案:Postgres could not connect to server

    【讨论】:

      【解决方案2】:

      试试rm /usr/local/var/postgres/postmaster.pid

      然后brew services restart postgresql

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2012-09-06
        • 2012-08-18
        • 1970-01-01
        • 1970-01-01
        • 2019-07-27
        • 1970-01-01
        • 1970-01-01
        • 2019-02-07
        相关资源
        最近更新 更多