windows安装mongodb(快速简易版)

1.下载mongodb-win32-x86_64-enterprise-windows-64-3.4.9.zip并解压,
然后创建数据文件和日志文件保存路径
d:\mongodb-win32-x86_64-enterprise-windows-64-3.4.9\data\db
d:\mongodb-win32-x86_64-enterprise-windows-64-3.4.9\log

2.创建配置文件mongod.cfg

systemLog:
    destination: file
    path: d:\mongodb-win32-x86_64-enterprise-windows-64-3.4.9\log\mongod.log
storage:
    dbPath: d:\mongodb-win32-x86_64-enterprise-windows-64-3.4.9\data\db

3.以管理员身份运行cmd 安装mongodb服务
"D:\mongodb-win32-x86_64-enterprise-windows-64-3.4.9\bin\mongod.exe" --config "D:\mongodb-win32-x86_64-enterprise-windows-64-3.4.9\mongod.cfg" --install

4.启停mongodb服务

net start MongoDB
net stop MongoDB

5.卸载mongodb服务
"D:\mongodb-win32-x86_64-enterprise-windows-64-3.4.9\bin\mongod.exe" --remove

6.连接mongodb并进行验证
先打开mongodb安装目录下的bin目录,然后执行mongo.exe
show dbs

技术分享离不开您的支持,您的支持是我源源不断的动力。

《windows安装mongodb(快速简易版)》 微信

《windows安装mongodb(快速简易版)》 支付宝

    原文作者:yuanyb
    原文地址: https://www.jianshu.com/p/78e60505f6fb
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞