Download Guide
macOS 系统
# 使用 Homebrew 安装
brew tap mongodb/brew
brew install mongodb-community在 Windows 系统中,打开命令提示符,运行以下命令:
比较计算得到的哈希值与官方提供的哈希值是否一致
brew tap mongodb/brew
brew install mongodb-community
Windows 系统
可以使用 Chocolatey 包管理器安装:
choco install mongodb
3.3 Docker 容器
# 拉取 MongoDB 镜像
docker pull mongo:latest
docker pull mongo:latest
# 运行 MongoDB 容器
docker run –name mongodb-container -p 27017:27017 -d mongo:latest
# 运行 MongoDB 容器并挂载数据卷
docker run –name mongodb-container -v /path/to/data:/data/db -p 27017:27017 -d mongo:latest
# MD5 验证
certutil -hashfile [安装文件路径] MD5
certutil -hashfile [安装文件路径] MD5
# SHA256 验证
certutil -hashfile [安装文件路径] SHA256
4.2 验证 MongoDB 安装
# 启动 MongoDB 服务
sudo systemctl start mongod
sudo systemctl start mongod
# 连接到 MongoDB
mongo
# 测试 MongoDB 连接
db.runCommand({ ping: 1 })
# 应该返回 { “ok” : 1 }
本文由风哥教程整理发布,仅用于学习测试使用,转载注明出处:http://www.fgedu.net.cn/10327.html
