我通过官方网站安装了Mongo Db。我还创建了下面的文件夹
~/data/db
我在该位置添加了mongo文件如下:
/usr/local/mongodb
我使用zsh,所以设置bash_profile中建议的环境变量对我不起作用。我的.zshrc文件如下所示
export PATH=$HOME/bin:/usr/local/bin:$PATH
export MONGO_PATH=/usr/local/mongodb
export PATH=MONGO_PATH/bin:$PATH
我还运行了如下的源代码命令:
source ~/.zshrc
然而,即使在尝试了各种不同的答案之后,我仍然得到:
zsh: command not found: mongo
我在这里错过了什么?
发布于 2019-08-15 19:42:02
发布于 2022-09-28 14:53:26
试试brew install mongodb-community-shell
。
我的案子:
我确实尝试过brew services start mongodb
来解决这个问题,但是我要面对这个问题:
Error: No available formula with the name "mongodb". Did you mean mongosh or monetdb?
下面是一个关于如何解决这个问题的建议,其中提到了brew install mongodb-community-shell
作为最新的Mongo:https://developpaper.com/fix-mac-brew-installation-mongodb-error-no-available-formula-with-the-name-mongodb/的一部分安装。
发布于 2022-10-16 12:13:12
这一款为me.in新macbook或air工作,我们找不到.zhrc
或bash
在新mac中,它的.zprofile
。因此,更改.zprofile
中的路径
export PATH=/opt/homebrew/bin:$PATH
https://stackoverflow.com/questions/53289509
复制相似问题