我是osx6.8,需要安装较早版本的Mongodb
,如何使用HomeBrew
安装较早版本?
下面没有工作:(
dream-2:app2 star$ brew install mongodb-2.6.10
Error: No available formula for mongodb-2.6.10
Searching formulae...
Searching taps...
dream-2:app2 star$
编辑:
我收到一条消息来解释这篇文章与另一篇文章相比有何独特之处,嗯,另一个问题的答案非常冗长和复杂,它特定于 postgresql
并没有真正回答我的问题。
最佳答案
Note: In September 2019
mongodb
was removed from homebrew core, so these instructions have been updated to usemongodb-community
instead, installed from the external tap.If your current installation is still the pre-September
mongodb
package then you will need to use that name when you unlink, stop, relink and start, on the lines marked with#*#
below.Another option is to simply upgrade away from the deprecated package now.
我已经安装了最新版本的 mongo,谢谢。
brew tap mongodb/brew
brew install mongodb-community
但有时我想切换到旧版本。首先,安装它:
brew search mongo
brew install mongodb-community@3.2
让我们停止当前的 mongodb,如果它正在运行:
brew services stop mongodb/brew/mongodb-community #*#
# or if you had started it manually
killall mongod
现在我想要 PATH 上的 3.2 而不是最新的:
brew unlink mongodb-community #*#
brew link --force mongodb-community@3.2
(显然它需要 --force
,因为它是仅桶装的。)
现在我的 PATH 上有 3.2,我可以启动测试数据库了:
mongod --version
brew services start mongodb/brew/mongodb-community
# or start your own mongod from the command-line
完成后,我可以反向切换回最新版本:
brew services stop mongodb/brew/mongodb-community
brew unlink mongodb-community@3.2
brew link mongodb-community #*#
brew services start mongodb/brew/mongodb-community #*#
然后重新启动。
https://stackoverflow.com/questions/30379127/