gpt4 book ai didi

database - psql : could not connect to server: No such file or directory when trying to run psql command

转载 作者:搜寻专家 更新时间:2023-10-30 20:55:25 26 4
gpt4 key购买 nike

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

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

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

最佳答案

你重装了 postgresql-9.6.3 了吗?

你需要完全卸载postgresql

sudo apt --purge autoremove postgresql*

sudo apt install postgresql-9.6

ubuntu16.04

关于database - psql : could not connect to server: No such file or directory when trying to run psql command,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23035111/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com