随笔 - 547  文章 - 213 评论 - 417 阅读 - 107万

 

 

1. Download MongoDB

2. Install MongoDB

3. Create the required folders:

"C:\MongoDB_2_6_Standard\bin\data\db"

"C:\MongoDB_2_6_Standard\logs"

"C:\MongoDB_2_6_Standard\etc"

NOTE: If the directories do not exist, mongod.exe will not start.

4. Create a simple configuration file:

systemLog:

destination: file

path: "C:\\MongoDB_2_6_Standard\\logs\\mongo.log"

logAppend: true

net:

bindIp: 127.0.0.1

port: 27017

(如果用记事本编辑总是报错,可是用notepad++打开后保存再保存。)

 [注] mongo 3.2和mongo3.6有些不同, 3.2默认是开启远程连接的,3.6默认是不开启的,要用bindIp或者bindIpAll:true来进行设置. 

More info about how to create a configuration file:http://docs.mongodb.org/manual/reference/configuration-options/

5. Install MongoDB as a Windows Service (this way it will start automatically when you reboot your computer)

Run cmd with administrator privilegies, and enter the following commands:

"C:\MongoDB_2_6_Standard\bin\mongod.exe" --config "C:\MongoDB_2_6_Standard\etc\mongodb.conf" --dbpath "c:\MongoDB_2_6_Standard\bin\data\db" --directoryperdb --install

6. Start the MongoDB Windows Service

net start MongoDB

7. Connect to MongoDB via shell/cmd for testing

C:\MongoDB_2_6_Standard\bin\mongo.exe

NOTE: http://docs.mongodb.org/manual/tutorial/getting-started-with-the-mongo-shell/

8. That's it! You are done. :)

9. Uninstall/remove the MongoDB Windows Service (if you messed up something)

"C:\MongoDB_2_6_Standard\bin\mongod.exe" --remove

posted on   今夜太冷  阅读(229)  评论(0编辑  收藏  举报
编辑推荐:
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
阅读排行:
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 地球OL攻略 —— 某应届生求职总结
· 提示词工程——AI应用必不可少的技术
· Open-Sora 2.0 重磅开源!
· 周边上新:园子的第一款马克杯温暖上架
点击右上角即可分享
微信分享提示