3

I am trying to install mongodb as a service on Windows 8.

I am using the following command to install Mongodb.

C:\mongodb\bin\mongod.exe --auth --config C:\mongodb\mongod.cfg --install

And I am getting this error:

 Wed Mar 13 19:13:23 Trying to install Windows service 'MongoDB'
 Wed Mar 13 19:13:23 Error connecting to the Service Control Manager: Access is denied. (5)

How can I install the Mongodb Service?

I tried this using Administrator privileges but the problem is still not solved.

Alojz Janez
  • 473
  • 2
  • 5
  • 16
mohammad mohsenipur
  • 205
  • 1
  • 2
  • 10

2 Answers2

3

The problem was occuring because the file mongod.cfg was not properly edited. Mongodb normally edits the content of mongod.cfg by itself but on windows 8 this did not work. And therefore this error showed up. I solved this problem by manually configuring the file and adding below code into the mongod.cfg file. Then I tried again and now it is working for me:

logpath=C:\mongodb\log\mongo.log
logappend=true
dbpath = /mongodb/data/db
Alojz Janez
  • 473
  • 2
  • 5
  • 16
mohammad mohsenipur
  • 205
  • 1
  • 2
  • 10
2

Please make sure that, the command prompt on which you running this command is running as Run as Administrator option.

MangeshBiradar
  • 1,820
  • 4
  • 16
  • 17