问题描述
我通过Homebrew安装了MongoDB(遵循 http://docs.mongodb.org/manual/tutorial/install-mongodb-on-os-x/),但无法正常工作.
I installed MongoDB via Homebrew (following http://docs.mongodb.org/manual/tutorial/install-mongodb-on-os-x/) but it's not working.
在shell提示符下键入mongod
会给我:
Typing mongod
at shell prompt gives me:
-bash: mongod: command not found
不确定我是否需要在PATH env var中添加Homebrew的内容?
Not sure if I need to add something for Homebrew to my PATH env var?
我可以看到Mongo已安装在/usr/local/Cellar/mongodb
下.但是假设我不需要将通过自制程序安装的所有内容添加到路径中吗?另外,假设我可以从任何目录运行mongod,或者实际上是要位于安装目录中?
I can see Mongo is installed under /usr/local/Cellar/mongodb
– but am assuming I don't need to add everything I install via homebrew to the path? Also, assuming I can run mongod from any directory or am I actually meant to be in install directory?
当我运行brew doctor
时,我得到:
Warning: You have unlinked kegs in your Cellar
其后是3个项目的列表,其中包括MongoDB–但我不确定如何链接它们?
Followed by a list of 3 items which includes MongoDB – but I'm not sure how I'm meant to link them?
推荐答案
完美运行
-
brew update
-
brew tap mongodb/brew
-
brew install mongodb-community@4.2
brew update
brew tap mongodb/brew
brew install mongodb-community@4.2
对于最新版本,请检查 https://docs.mongodb.com/manual/release-笔记/
For latest version, check https://docs.mongodb.com/manual/release-notes/
这篇关于通过Homebrew安装的MongoDB无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!