【发布时间】:2015-02-06 06:22:27
【问题描述】:
我正在尝试使用 home brew 在我的 MAC 上安装 PostgreSQL,当我尝试运行命令 psql 时出现以下错误
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
【问题讨论】:
-
程序问你一个问题,
/tmp/.s.PGSQL.5432呢?是否安装了两个版本的 psql? -
@Schwern 我该如何检查?
-
ls -l /tmp/.s.PGSQL.5432检查临时文件。which -a psql检查多个安装。 -
@Schwern ls: /tmp/.s.PGSQL.5432: 没有这样的文件或目录
-
@Schwern roughamv$ which -a psql /usr/local/bin/psql
标签: macos postgresql