Turn from:
http://blog.csdn.net/lingchen214/article/details/24537629
1 Customize the installation to the C:\mongodb directory.
2 Create DATA\DB and logs two folders manually under the C:\mongodb directory
3 start cmd as an administrator and go to C:\mongodb\bin as the current directory.
c:\mongodb\bin> Echo logpath=c:\mongodb\logs\mongodb.log> c:\mongodb\mongod.cfg
c:\mongodb\bin> Echo dbpath=c:\mongodb\data\db>> c:\mongodb\mongod.cfg
4
[CPP]View Plaincopy
- C:\MONGODB\BIN>SC Create MongoDB binpath= "\" c:\mongodb\bin\mongod.exe\ "--service--config=\" c:\mongodb\ Mongod.cfg\ "" Displayname= "MongoDB 2.6 stardard" start= "Auto"
This will prompt CreateService to succeed
Note that after each "=" in the input command, there will be a space, except for the--config
5 net start MongoDB
At this point, the auto-running MongoDB service is created successfully.
Reference article: mongodb-2.6.0 Installation and service start-up under Win7 64
mongodb-2.6.0 installation and service start-up under Win7 64