Luc*_*ord 8 database postgresql shell command-line
我想在我的本地机器上使用预安装的postgresql(mac os 10.7.5),当我运行时which psql我找到它(in /usr/bin/psql),但随后运行
pg_ctl -D /usr/bin/psql -l /usr/bin/psql/server.log start
Run Code Online (Sandbox Code Playgroud)
结果是:
-bash: pg_ctl: command not found
Run Code Online (Sandbox Code Playgroud)
如何启动/使用我的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"?
Run Code Online (Sandbox Code Playgroud)
OS X附带命令行客户端(用于与postgres数据库交互)而不是服务器.
您需要安装服务器.