开发者

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 you


You 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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜