gpt4 book ai didi

Postgresql (psql) 客户端期望套接字位于与 postgresql-server 不同的位置

转载 作者:行者123 更新时间:2023-11-29 13:31:15 25 4
gpt4 key购买 nike

在尝试连接到在我的工作站上本地运行的 postgres 时,我得到:

$ sudo -u postgres psql -c "create role ..."
could not change directory to "/home/esauer/workspace/cfme"
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"?

我的 postgres-server 安装在 /var/run/postgresql 中创建套接字。

如何让客户查看正确的位置?

最佳答案

使用 psql --help 检查 --host 选项。

然后您可以通过在您的.psqlrc 用户文件中设置它来使其永久化。

在你的情况下尝试:

psql -h/var/run/postgresql -d your_database

关于Postgresql (psql) 客户端期望套接字位于与 postgresql-server 不同的位置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22617370/

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