psql: could not connect to server: No such file or directory on MAC OSX
我试图使用
1 2 3 4 | 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"? |
看起来系统无法识别安装。
1 2 3 | Harshas-MacBook-Pro:~ harshamv$ locate psql | grep /bin /usr/LOCAL/Cellar/postgresql/9.4.0/bin/psql /usr/LOCAL/bin/psql |
这个过程似乎正在运行
1 2 | Harshas-MacBook-Pro:~ harshamv$ ps -aef|grep postgres 501 12075 11832 0 11:54AM ttys001 0:00.00 grep postgres |
也是plist文件
1 2 3 4 5 6 7 8 9 | 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 |
你没有运行PostgreSQL服务器。 您的
您也可能安装了两个版本的PostgreSQL,并且您正在运行与错误的一个相关联的psql客户端。 您可以运行
PostgreSQL Wiki有一个专门用于解决Homebrew问题的页面。
这个对您确切问题的答案可能有所帮助。