postgresql - 在Mac上启动 - `pg_ctl`不工作
我想在我的本地机器上使用预安装的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"?
谢谢,我现在试了postgerapp,并更新了'.zshrc'文件中的路径,但仍然收到相同的错误:'psql:无法连接到服务器:没有这样的文件或目录 服务器是否在本地运行,在Unix域套接字上接受 连接“/var/pgsql_socket/.s.PGSQL.5432”?' – 2013-04-20 11:54:29
我最终使用自制软件来安装postgres本身 – 2013-04-20 19:25:49
感谢上帝这个问题是不会被删除。投票重新开放。 – djechlin 2014-06-01 15:00:45