当尝试连接到我的工作站上本地运行的 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"?
Run Code Online (Sandbox Code Playgroud)
我的 postgres-server 安装在/var/run/postgresql.
如何让客户看向正确的位置?
用 检查该--host选项psql --help。
然后您可以通过在用户文件中设置它来使其永久化.psqlrc。
在你的情况下尝试:
psql -h /var/run/postgresql -d your_database
| 归档时间: |
|
| 查看次数: |
15821 次 |
| 最近记录: |