Tia*_*ian 5 unix postgresql macos
我通过MacPorts安装了PostgreSQL.但是,/opt/local/lib/postgresql84/bin我无法执行任何pg命令.有谁知道我做错了什么?
Gre*_*ill 18
当你说"转到"时,听起来你正在使用cd命令更改到该目录.就像是:
$ cd /opt/local/lib/postgresql84/bin
$ psql
psql: command not found
Run Code Online (Sandbox Code Playgroud)
通常在Unix系统上,当前目录不是可执行搜索路径的一部分.所以要么psql使用./以下方法从当前目录显式执行:
$ cd /opt/local/lib/postgresql84/bin
$ ./psql
Run Code Online (Sandbox Code Playgroud)
或者,将目录添加到您的PATH:
$ export PATH=/opt/local/lib/postgresql84/bin:$PATH
$ psql
Run Code Online (Sandbox Code Playgroud)
我已经用 dmg 安装了 postgres(Mac,The capan SO),我也遇到了同样的问题。我不得不通过 brew 安装 psql。试试这个:
brew install postgres
Run Code Online (Sandbox Code Playgroud)
这对我有用。