【发布时间】:2013-04-02 14:50:17
【问题描述】:
我越来越有名了
psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/pgsql_socket/.s.PGSQL.5432"?
在 OSX Mountain Lion 的终端中尝试createdb 时出错,因此按照说明here,我将export PATH=/opt/local/lib/postgresql92/bin:$PATH 添加到我的.bash_profile,现在如果我输入which psql 我得到/opt/local/lib/postgresql92/bin/psql(以前我在哪里得到/usr/bin/psql)。
但是,如果我现在尝试createdb database,会提示我输入一个我不知道的密码(这不是我的默认用户密码),如果我两次输入错误,我会得到:
createdb: could not connect to database template1:
FATAL: password authentication failed for user "username"
username 是我在终端中的默认用户名。我要做的是创建一个 PostgreSQL 数据库,我可以从一个生活在 virtualenv 中的 Django 项目中访问。我正在使用 PostgreSQL 9.2。我做错了什么?
【问题讨论】:
标签: django postgresql osx-mountain-lion virtualenv