running MongoDB using mongod.exe
I have the mongoDB works well in my computer .
but every time I want to run it I should go to the CM开发者_开发技巧D and type :c:\mongoDB\bin\mongod --dbpath c:\mongoDB\data\db
and if I close the CMD window the connection will ends up .
So I'm wondering if I want to upload my App to online website , how should the mongoDB works !? Thank youYou can run mongodb as a Windows service
e.g. set up as a windows service
mongod --install --serviceName "MongoDB" --dbpath C:\mongodb\data\db
--logpath C:\mongodb\logs\mongolog.txt --logappend
Then you can start the service from CMD using:
net start mongodb
Or, you can start it via Control Panel -> Administrative Tools -> Services. You can then just set it to start automatically on Windows start.
精彩评论