Workaround to install as a service

You can manually install 2.6.0 as a service on Windows from an Administrator cmd prompt.

Assuming you have installed MongoDB using the MSI installer, the default path will be C:\Program Files\MongoDB 2.6 Standard. If you have installed in an alternative directory you will need to adjust the paths as appropriate.

Steps to install:

1) Open an Administrator command prompt

  • Windows 7 / Vista / Server 2008 (and R2)

    • Press Win + R, then type "cmd", then press Ctrl + Shift + Enter.
  • Windows 8 / 8.1
    • Press Win + X, then press A.

2. Make directories for your database and log files

mkdir c:\data\db
mkdir c:\data\log

3. Create a configuration file. This file can include any of the configuration options for mongod, but at a minimum must include a valid setting for logpath:

echo logpath=c:\data\log\mongod.log> "C:\Program Files\MongoDB 2.6 Standard\mongod.cfg"
echo dbpath=c:\data\db>> "C:\Program Files\MongoDB 2.6 Standard\mongod.cfg"

4. Create the MongoDB service

sc create MongoDB binPath= "\"C:\Program Files\MongoDB 2.6 Standard\bin\mongod.exe\" --service --config=\"C:\Program Files\MongoDB 2.6 Standard\mongod.cfg\"" DisplayName= "MongoDB 2.6 Standard" start= "auto"

Note that sc requires a space between "=" and the configuration values (eg "binPath= "), and a "\" to escape double quotes.

If this works you should see:

[SC] CreateService SUCCESS

5. Start the MongoDB service:

net start MongoDB

If successful you should be able to connect using the mongo shell. If the service did not start successfully, the log file should contain information to help you troubleshoot.

最新文章

  1. python学习 3笔记
  2. SVM经典论文
  3. 第九章 硬件抽象层:HAL
  4. 【浅墨Unity3D Shader编程】之一 夏威夷篇:游戏场景的创建 & 第一个Shader的书写
  5. jQuery.fn.extend与jQuery.extend到底区别在哪?
  6. Seo的几个境界
  7. 用python自定义实现db2的连接池
  8. 【python游戏编程之旅】第一篇---初识pygame
  9. PostgreSQL中字符串相关问题
  10. shell脚本之间互相调用
  11. HW5.4
  12. CSS3新增Hsl、Hsla、Rgba色彩模式以及透明属性(转)
  13. svn 同步到web目录
  14. 华为-on演习--身高找到最好的二人
  15. bootstrap弹出框
  16. FreeNAS插件打造ownCloud私有云网盘
  17. Python基础:六、变量和常量
  18. javascript基础知识笔记-自用
  19. loj2353. 「NOI2007」 货币兑换
  20. [转]【Angular4】基础(二):创建组件 Component

热门文章

  1. H3BPM实例分享——金额规则大写
  2. Kaggle爆文:一个框架解决几乎所有机器学习问题
  3. BZOJ 1196 二分+Kruskal
  4. Centos 6 搭建邮箱服务器教程
  5. sql server 创建索引 超时时间已到
  6. USB接口大全
  7. angular4搭建博客(一)
  8. Find Bugs
  9. .bat 打开程序
  10. Block Functionality