【问题标题】:psql: could not connect to server: No such file or directory when trying to run psql commandpsql:无法连接到服务器:尝试运行 psql 命令时没有这样的文件或目录
【发布时间】:2014-04-12 19:29:31
【问题描述】:

当我尝试以用户 postgres 运行 psql 命令时,我会收到此错误。

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

我尝试像他们在这篇文章中所使用的那样指定端口Connecting to PostgreSQL gives "could not connect to server" error,但我仍然遇到同样的错误。奇怪的是,当我尝试重新安装 psql 时它可以正常工作,但是每次我关闭计算机并重新打开它时,我最终都会遇到同样的错误。

【问题讨论】:

  • 根据最后一句话,您的实际问题是 postgresql 不会在您的计算机上启动时启动。

标签: database postgresql-9.1


【解决方案1】:

您是否重新安装了 postgresql-9.6.3 ?

你需要完全卸载postgresql

sudo apt --purge autoremove postgresql*

sudo apt install postgresql-9.6

ubuntu16.04

【讨论】:

    猜你喜欢
    • 2018-01-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-04-08
    • 1970-01-01
    • 1970-01-01
    • 2018-05-12
    • 2014-10-22
    相关资源
    最近更新 更多