[英]How to install Mongodb on Apple M1 chip
I'm trying to install Mongodb community server on macbook air with the new M1 chip following the official mongodb tutorial .我正在尝试按照官方 mongodb 教程使用新的 M1 芯片在 macbook air 上安装 Mongodb 社区服务器。 However im running into this problem.但是我遇到了这个问题。
~ ❯❯❯ brew install mongodb-community@4.4
Error: Cannot install in Homebrew on ARM processor in Intel default prefix (/usr/local)!
Please create a new installation in /opt/homebrew using one of the
"Alternative Installs" from:
https://docs.brew.sh/Installation
You can migrate your previously installed formula list with:
brew bundle dump
Any help with installing mongodb on m1 would be very helpful在 m1 上安装 mongodb 的任何帮助都会非常有帮助
I was getting the same problem, on the MacBook pro m1.我在 MacBook pro m1 上遇到了同样的问题。 I changed the terminal settings to Rosetta and then tried to install the brew.我将终端设置更改为 Rosetta,然后尝试安装 brew。
For this process, tap with double fingers on the terminal and click on Get Info, and in the menu, click on Open using Rosetta.在此过程中,用双指点击终端并单击获取信息,然后在菜单中单击使用 Rosetta 打开。
Now restart the terminal again and try to install the brew again with this link in the terminal.现在再次重新启动终端并尝试在终端中使用此链接再次安装 brew。
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh )" /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh )"
Now your brew is installed, use this to install MongoDB now, it will work smoothly.现在你的brew已经安装好了,现在用它来安装MongoDB,它会顺利运行的。 You can check the documentation for further process, as it won't make more issues.您可以查看文档以了解进一步的过程,因为它不会产生更多问题。
https://docs.mongodb.com/manual/tutorial/install-mongodb-on-os-x/ https://docs.mongodb.com/manual/tutorial/install-mongodb-on-os-x/
This was a problem with brew and fish shell.这是 brew 和 fish shell 的问题。 It works now when installing from bash.从 bash 安装时,它现在可以工作。 Mods can remove this or whatever they like模组可以删除这个或他们喜欢的任何东西
Article on how to install mongodb on apple m1 using homebrew关于如何使用自制软件在苹果 m1 上安装 mongodb 的文章
xcode-select --install xcode-选择--安装
brew tap mongodb/brew酿造水龙头 mongodb/酿造
brew install mongodb-community@5.0酿造安装 mongodb-community@5.0
mongo --version蒙戈--版本
brew services start mongodb-community@5.0酿造服务启动 mongodb-community@5.0
and to stop mongoDB to run as a background service use并停止 mongoDB 作为后台服务使用
brew services stop mongodb-community@5.0酿造服务停止 mongodb-community@5.0
Or, if you don't want/need a background service you can just run:或者,如果您不想要/不需要后台服务,您可以运行:
mongod --config /opt/homebrew/etc/mongod.conf mongod --config /opt/homebrew/etc/mongod.conf
To run mongodb commands, open a new table and run mongo要运行 mongodb 命令,打开一个新表并运行mongo
To check your databases run show dbs要检查您的数据库,请运行show dbs
You need to enable Rosetta in your terminal,您需要在终端中启用 Rosetta,
xcode-select --install
使用xcode-select --install
安装 xcode 命令行brew tap mongodb/brew
现在安装 mongodb 使用brew tap mongodb/brew
arch -arm64 brew install mongodb-community@5.0
然后arch -arm64 brew install mongodb-community@5.0
Warning: A newer Command Line Tools release is available.
Update them from Software Update in System Preferences or run:
softwareupdate --all --install --force
If that doesn't show you any updates, run:
sudo rm -rf /Library/Developer/CommandLineTools
sudo xcode-select --install
mongo --version
要检查 mongodb 是否已安装,请使用mongo --version
brew services start mongodb-community@5.0
要将 mongoDB 作为 macOS 服务启动,请使用brew services start mongodb-community@5.0
brew services stop mongodb-community@5.0
要停止 mongoDB 作为后台服务运行,请使用brew services stop mongodb-community@5.0
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.