当前位置: 首页 > 知识库问答 >
问题:

PSQL:无法连接到服务器:MAC OSX上没有这样的文件或目录

姜鸿
2023-03-14
Harshas-MacBook-Pro:~ harshamv$ psql
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"?
Harshas-MacBook-Pro:~ harshamv$ locate psql | grep /bin
/usr/local/Cellar/postgresql/9.4.0/bin/psql
/usr/local/bin/psql
    Harshas-MacBook-Pro:~ harshamv$ ps -aef|grep postgres  
      501 12075 11832   0 11:54AM ttys001    0:00.00 grep postgres

也是plist文件

Harshas-MacBook-Pro:~ harshamv$ launchctl load -w /usr/local/Cellar/postgresql/9.4.0/homebrew.mxcl.postgresql.plist  
/usr/local/Cellar/postgresql/9.4.0/homebrew.mxcl.postgresql.plist: Operation already in progress


Harshas-MacBook-Pro:~ harshamv$ which psql
/usr/local/bin/psql

Harshas-MacBook-Pro:~ harshamv$ echo $PATH
/Users/harshamv/.rvm/gems/ruby-2.1.2/bin:/Users/harshamv/.rvm/gems/ruby-2.1.2@global/bin:/Users/harshamv/.rvm/rubies/ruby-2.1.2/bin:/Applications/bin/php5/bin/:/Applications/Mamp/htdocs/prayag/lib/Cake/Console:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/harshamv/.rvm/bin:/usr/local/mongodb/bin

共有1个答案

东门俊智
2023-03-14

您没有运行PostgreSQL服务器。您的ps输出仅显示您自己的ps grep。

您还可能安装了两个版本的PostgreSQL并且运行的PSL客户机与错误的psql客户机相关联。您可以运行whic-a psql查看路径中的所有psql二进制文件。

PostgreSQL Wiki有一个专门解决自制问题的页面。

 类似资料: