Transferred from: http://winfan.net/655.html
1. Download MongoDB Package
2. Unzip the zip to D:\MongoDB
3. Create a directory D:\MongoDB\data\db
4. Create a log directory D:\MongoDB\log
5. Create the configuration file D:\MongoDB\mongod.cfg content as follows
123456789 |
systemLog: destination: file path: D:\MongoDB\log\mongo.log net: bindIp: 127.0.0.1 port: 27017 storage: dbPath: D:\MongoDB\data\db directoryPerDB: true |
6. Open C:/windows/system32/cmd.exe with administrator to execute the following command
1 |
d:\MongoDB\bin\mongod.exe --config d:\MongoDB\mongod.cfg --install |
Then execute
1 |
sc create MongoDB binPath= "d:\MongoDB\bin\mongod.exe --config=d:\MongoDB\mongod.cfg --service" displayname= "MongoDB 2.6 Standard Server" start= auto |
PS: How to remove this service: then SC delete MongoDB
7: Open Service
12 |
net start MongoDB //开启服务 net stop MongoDB //停止服务 |
WINDOWS8 system Installation MongoDB 2.6.3 Configuration service startup