将MongoDB作为服务在windows中安装!
D:\mongodb\bin>mongod --dbpath d:\mongo\data\db --logpath d:\mongo\data\log\mong
odb.log --install --serviceName MongoDB
Sat Mar 08 23:12:22.259 Trying to install Windows service 'MongoDB'
Sat Mar 08 23:12:22.295 Service 'MongoDB' (Mongo DB) installed with command line
'D:\mongodb\bin\mongod.exe --dbpath d:\mongo\data\db --logpath d:\mongo\data\lo
g\mongodb.log --service'
Sat Mar 08 23:12:22.295 Service can be started from the command line with 'net s
tart MongoDB'
D:\mongodb\bin>net start MongoDB
Mongo DB 服务已经启动成功。