[英]Postgresql Error in psql command not found in zsh mac
I have installed postgresql on my mac!我已经在我的 mac 上安装了 postgresql!
zsh: command not found: psql
I have located the location of my psql command (with other all postgres commands + pgadmin) and it is in /Users/Library/PostgreSQL/13/bin我找到了我的 psql 命令的位置(以及其他所有 postgres 命令 + pgadmin),它位于 /Users/Library/PostgreSQL/13/bin
when I do echo $PATH I get:当我 echo $PATH 我得到:
/Library/Frameworks/Python.framework/Versions/3.8/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
/Users/Library/PostgreSQL/13/bin
is not in your "path" /Users/Library/PostgreSQL/13/bin
不在您的“路径”中
Easy solution would be to create a symbolic link for psql
in /usr/local/bin/
:简单的解决方案是在/usr/local/bin/
中为psql
创建一个符号链接:
ln -s /Users/Library/PostgreSQL/13/bin/psql /usr/local/bin/psql
Otherwise you can edit your profile file and extend your path to /Users/Library/PostgreSQL/13/bin
否则,您可以编辑您的配置文件并将路径扩展到/Users/Library/PostgreSQL/13/bin
I also had the same issue and a simple solution is to restart the terminal.我也有同样的问题,一个简单的解决方案是重新启动终端。 It gives an opportunity for terminal to reload Postgres.它为终端重新加载 Postgres 提供了机会。
I didn't have a .zshrc
file and created one (peeped here link )我没有.zshrc
文件并创建了一个(在此处查看链接)
Steps for creation:创建步骤:
touch ~/.zshrc
to create the respective file.键入touch ~/.zshrc
以创建相应的文件。 ( touch
command will create the .zshrc
in your current directory but it will be hidden) ( touch
命令将在您当前目录中创建.zshrc
但它将被隐藏)Return
点击Return
To view/open ~/.zshrc
you can do either of two things:要查看/打开~/.zshrc
你可以做两件事之一:
Cmd
+ Shift
+ .
打开 Finder > 按Cmd
+ Shift
+ .
(and you will see hidden files) (你会看到隐藏文件)Or:要么:
open ~/.zshrc
打开终端 > 并输入: open ~/.zshrc
Editing .zshrc
编辑.zshrc
.zshrc
in editor and pasted this line:在编辑器中打开.zshrc
并粘贴此行:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.