尝试连接到在本地运行的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
。
我如何让客户寻找合适的位置?
用检查--host
选项psql --help
。
然后,可以通过在.psqlrc
用户文件中设置它来使其永久。
在您的情况下,请尝试:
psql -h /var/run/postgresql -d your_database
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句