我想在我的本地機器上使用預安裝的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