postgresql - 开始在mac - `pg_ctl`不工作 [英] postgresql - start on mac - `pg_ctl` not working
问题描述
我想在我的本地机器上使用预装的postgresql(mac os 10.7.5),当我运行其中psql
我发现它$ c> / usr / bin / psql ),但后来运行
I want to use the pre-installed postgresql on my local machine (mac os 10.7.5), when I run which psql
I find it (in /usr/bin/psql
), but then running
pg_ctl -D /usr/bin/psql -l /usr/bin/psql/server.log start
/ p>
results in:
-bash: pg_ctl: command not found
如何开始/使用我的postgresql数据库?我需要安装它(用说自制)或者我可以使用预装在我的mac上吗?
我也尝试使用 initdb
命令( initdb / usr / bin / psql -E utf8
)和也会出现相同的消息: -bash:initdb:command not found
。
How can I start/use my postgresql database? do I need to install it (with say Homebrew) or can I use the pre-installed one on my mac?
I also tried using the initdb
command (initdb /usr/bin/psql -E utf8
) and also go tthe same message: -bash: initdb: command not found
.
$ c> psql 与 postgres
相同? (我试过其中postgres
没有任何东西)
Also, is this psql
the same as postgres
? (I tried which postgres
and got nothing)
更新:我使用 psql
和
psql -a
命令行中的命令, code>例如):
Update: I'm using psql
commands in the command line, but am getting there the following message (for psql -l
and psql -a
for instance):
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"?
推荐答案
OS X附带命令行客户端与postgres数据库)而不是服务器。
OS X ships with the command line client (for interacting with postgres databases) not the server.
您需要安装服务器。
检查 postgres网站或抓取 postgres.app
这篇关于postgresql - 开始在mac - `pg_ctl`不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!