天天看點

mongodb Install the MongoDB service

  在用到mongodb時,首先要運作mongod.exe以啟動mongo,這樣就會出現指令框( command prompt),為了避免出現這種情況。要以服務的形式來啟動mongo,這樣就不會出現指令框了。

1、以管理者身份打開指令框

2、建立目錄

mongodb Install the MongoDB service

3、c:\mongodb 在目錄下建立檔案mongod.cfg

mongodb Install the MongoDB service

回車

5、啟動mongodb服務

net start mongodb

mongodb Install the MongoDB service
mongodb Install the MongoDB service

6、關閉mongodb服務

net stop mongodb

mongodb Install the MongoDB service
mongodb Install the MongoDB service