Reputation: 6403
I have the mongoDB works well in my computer .
but every time I want to run it I should go to the CMD 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
Upvotes: 0
Views: 1022
Reputation: 147224
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.
Upvotes: 1