net start mongodb 不成功,试了网上很多方法,还是不行
mongod --dbpath "D:\mongodb\data\db" --directoryperdb --logpath "D:\mongodb\data\log\mongodb.log" --install --serviceName "MongoDB"
mongod --dbpath "D:\mongodb\data\db" --directoryperdb --logpath "D:\mongodb\data\log\mongodb.log" --remove --serviceName "MongoDB"
mongod --install --directoryperdb --dbpath D:\mongodb\data\db --logpath D:\mongodb\data\log\mongodb.log --logappend --rest --serviceName "MongoDB"
mongod --install --directoryperdb --dbpath D:\mongodb\data\db --logpath D:\mongodb\data\log\mongodb.log --logappend --rest --serviceName "MongoDB"
On windows you first have to
install mongodb as a service using the --install option.
The commands you can use a command similar to the following to install it as a service.
mongod --install --directoryperdb --dbpath C:\mongodb-win32-x86_64-2.4.6\data --logpath C:\mongodb-win32-x86_64-2.4.6\log\mongodb.log --logappend --rest
The command above must be run with administrator privileges. After that is done you can then use the net start and net stop commands provided by Hugo. – Ed Ost Aug 31 '13 at 19:41
mongod --dbpath D:\mongodb\data\db