[英]Run mongod in ZSH shell on Mac and and get command not found
I'm trying to run mongod
in my terminal, but I'm getting a command not found
.我试图在我的终端中运行
mongod
,但我得到了一个command not found
。 I've consulted other questions on this issue, including this these: mac: command not found: mongod Mongod: Command Not Found (OS X)我已经咨询过关于这个问题的其他问题,包括这些: mac: command not found: mongod Mongod: Command Not Found (OS X)
But the solutions have not worked for me.但是解决方案对我不起作用。
Here is the full path of mongod:这是mongod的完整路径:
/Users/danno/mongodb/bin/mongod
In.zshrc, I've tried two scripts, but neither one works:在.zshrc 中,我尝试了两个脚本,但都没有工作:
Attempt 1 (from other Stack Overflow questions):尝试 1(来自其他 Stack Overflow 问题):
export PATH="$PATH:/usr/local/mongodb/bin"
Attempt 1 (My own guess):尝试1(我自己的猜测):
export PATH="$PATH:/Users/danno/mongodb/bin/mongod"
I've restarted the terminal multiple times to no avail.我已经多次重启终端无济于事。
From the terminal, I'm trying to run:从终端,我正在尝试运行:
mongod --dbpath=/Users/danno/mongodb-data
Getting a command not found while running that and also just with mongod
alone.运行该命令时找不到命令,并且仅使用
mongod
即可。
Is something wrong with my pathing?我的路径有问题吗?
Maybe you forgot to do this step:也许你忘了做这一步:
$ source ~/.bash_profile
It is better to put $PATH at the end.最好把 $PATH 放在最后。
I hope this will help.我希望这将有所帮助。 Additional options can be found in the post and the video.
可以在帖子和视频中找到其他选项。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.