当前位置: 首页 > news >正文

mac安装mongoDB的正确姿势

testmanzhang@TestMandeMBP corpora % brew tap mongodb/brew
testmanzhang@TestMandeMBP corpora % brew search mongodb
testmanzhang@TestMandeMBP corpora % brew install mongodb-community@7.0

依次执行上面的命令后开始安装mongoDB,但是安装过程中有很多报错,例如:

Error: openjdk: Failed to download resource "openjdk"
...
Error: pango: Failed to download resource "pango"
...
Error: ffmpeg@6: Failed to download resource "aom"
...
Error: ffmpeg: Failed to download resource "x265"
...
Error: gtk4: Failed to download resource "gtk4"
...
Error: libsoup: Failed to download resource "sqlite"
...
Error: python@3.13: Failed to download resource "python@3.13"
...
Error: gstreamer: Failed to download resource "ffmpeg"
...
Error: allure: Failed to download resource "openjdk"
...
Error: qt: Failed to download resource "qt"
...
Error: pyqt: Failed to download resource "qt"
...
Error: vtk: Failed to download resource "python@3.13"
...
Error: opencv: Failed to download resource "openvino"
...

报错有点多,可能是姿势不对,一个一个解决有点麻烦,可能有的跟mongoDB也没有关系,但是强迫症,看着不舒服,重装!

先卸载mongoDB:

testmanzhang@TestMandeMBP corpora % brew uninstall mongodb-community@7.0
testmanzhang@TestMandeMBP corpora % brew uninstall mongodb-database-tools

清除homebrew缓存:

testmanzhang@TestMandeMBP corpora % brew cleanup

删除mongoDB的残存文件:

testmanzhang@TestMandeMBP corpora % rm -rf /usr/local/var/mongodb
testmanzhang@TestMandeMBP corpora % rm -rf /opt/homebrew/var/mongodb

先更新一下homebrew:

testmanzhang@TestMandeMBP corpora % brew update

重新安装mongoDB:

testmanzhang@TestMandeMBP corpora % brew tap mongodb/brew
testmanzhang@TestMandeMBP corpora % brew install mongodb-community@7.0

这回安装比较顺利,没有报错!!!

启动mongoDB:

testmanzhang@TestMandeMBP corpora % brew services start mongodb/brew/mongodb-community@7.0
==> Successfully started `mongodb-community@7.0` (label: homebrew.mxcl.mongodb-community@7.0)

关闭mongoDB:

testmanzhang@TestMandeMBP corpora % brew services stop mongodb/brew/mongodb-community@7.0
Stopping `mongodb-community@7.0`... (might take a while)
==> Successfully stopped `mongodb-community@7.0` (label: homebrew.mxcl.mongodb-community@7.0)

连接mongoDB:

mongosh
testmanzhang@TestMandeMBP ~ % mongosh   
Current Mongosh Log ID:	67e2a00939223a773679ef31
Connecting to:		mongodb://127.0.0.1:27017/?directConnection=true&serverSelectionTimeoutMS=2000&appName=mongosh+2.4.2
Using MongoDB:		7.0.17
Using Mongosh:		2.4.2

For mongosh info see: https://www.mongodb.com/docs/mongodb-shell/

------
   The server generated these startup warnings when booting
   2025-03-25T20:22:23.392+08:00: Access control is not enabled for the database. Read and write access to data and configuration is unrestricted
------

test> 


文章转载自:

http://fqSUhs9n.dbbcq.cn
http://mEXRzxvI.dbbcq.cn
http://m9zTtTnr.dbbcq.cn
http://gaDxdtCr.dbbcq.cn
http://LD456neS.dbbcq.cn
http://0nWb0dy2.dbbcq.cn
http://DF866Fl2.dbbcq.cn
http://BK03uU6s.dbbcq.cn
http://gO5ymLNu.dbbcq.cn
http://UFhyGQtt.dbbcq.cn
http://c0RxG9r0.dbbcq.cn
http://LEeJXdYP.dbbcq.cn
http://zfnRuCxV.dbbcq.cn
http://qdsCSen8.dbbcq.cn
http://coaTNSdJ.dbbcq.cn
http://SXpAkk5V.dbbcq.cn
http://VMitCkEX.dbbcq.cn
http://KQl6qVE1.dbbcq.cn
http://HuUZ0H9r.dbbcq.cn
http://TwhdRFV9.dbbcq.cn
http://JXB7m5NC.dbbcq.cn
http://bgOqN6GC.dbbcq.cn
http://Xu2cupSX.dbbcq.cn
http://oEglRNCN.dbbcq.cn
http://UzAmKjMv.dbbcq.cn
http://sLeCf7gK.dbbcq.cn
http://i8Dm5A5F.dbbcq.cn
http://ZGhcj4sX.dbbcq.cn
http://HmJup7hr.dbbcq.cn
http://LnVAdR5o.dbbcq.cn
http://www.dtcms.com/a/89657.html

相关文章:

  • 蓝桥杯第十届 特别的数
  • 3DGS较真系列
  • MyBatis打印SQL日志的配置
  • 单纯形法之两阶段法
  • 命令行HTTP客户端:HTTPie
  • C++基础系列【28】string的split
  • SMOTE算法
  • C++类与对象的的第三个简单的实战练习-3.25笔记
  • SvelteKit 最新中文文档教程(10)—— 部署 Cloudflare Pages 和 Cloudflare Workers
  • 【HarmonyOS Next】三天撸一个BLE调试精灵
  • 记录firefly的3566-sdk的下载及解压更新
  • docker使用命令笔记
  • Java多线程精讲:线程操作与状态转换全解析
  • Mycat安装验证流程整理
  • 深度学习|表示学习|多头注意力在计算时常见的张量维度变换总结|28
  • C盘急救实录:从爆红到畅快
  • 量子计算模拟中的测量与噪声建模:基于 3 量子比特系统分析
  • AI-Sphere-Butler之Ubuntu服务器如何部署Nginx代理,并将HTTP升级成HTTPS,用于移动设备访问
  • 余弦退火算法与学习率预热
  • Apache HttpClient使用
  • 内核编程十二:打印task_struct中的数据
  • 高性能C#定时删除图片,包含定时触发、分批删除、异步处理和资源监控
  • JavaScript基础-常用的鼠标事件
  • 卷积神经网络的原理、实现及变体
  • c语言基础编程入门练习题(三)
  • 工欲善其事必先利其器————idea插件
  • 11_JavaScript_字符串方法+数学方法
  • react中防止数据多大并需要二次加工处理进行单线程转多线程webworker优化处理(不借助react-webworker)
  • Python Sanic面试题及参考答案
  • 东软鸿蒙C++开发面经