我想在我的本地机器上使用预安装的postgresql(mac os 10.7.5),当我运行which psql
时我发现它(在/usr/bin/psql
),但后来运行postgresql - 在Mac上启动 - `pg_ctl`不工作
pg_ctl -D /usr/bin/psql -l /usr/bin/psql/server.log start
结果:
-bash: pg_ctl: command not found
我如何启动/用我的PostgreSQL数据库?我是否需要安装它(用Homebrew说)或者我可以使用我的Mac上预装的吗? 我也尝试使用initdb
命令(initdb /usr/bin/psql -E utf8
),并且也使用相同的消息:-bash: initdb: command not found
。
另外,这是psql
是否与postgres
相同? (我试过which postgres
并没有什么)
更新:我使用的命令行psql
命令,但我得到有以下消息(psql -l
和psql -a
为例):
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"?
感谢上帝这个问题是不会被删除。投票重新开放。 – djechlin 2014-06-01 15:00:45