Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

closed as off-topic by Wesley, mdpc, Ward, MichelZ, Dave M Apr 12 at 18:14

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions must be relevant to professional system administration. Server Fault is dedicated to professional system and network administrators. End user and enthusiast questions are off-topic (contact your system administrator or hire a professional to help you out). Please see the Help Center for more information." – Wesley, mdpc, Ward, MichelZ, Dave M
If this question can be reworded to fit the rules in the help center, please edit the question.

    
Please make sure that, the command prompt on which you running this command is running as Run as Administrator option. –  meMangesh Mar 14 '13 at 11:40
    
I Running as Administrator but the problem not solve –  mohammad mohsenipur Mar 14 '13 at 11:43

2 Answers 2

up vote 2 down vote accepted

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
share|improve this answer

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

share|improve this answer
    
I Running as Administrator but the problem not solve –  mohammad mohsenipur Mar 14 '13 at 11:44
1  
This seems like a Permission error. Please make sure that you have correct administrative privileges –  meMangesh Mar 14 '13 at 11:48
    
I an sure about cmd that is running as Administrator –  mohammad mohsenipur Mar 14 '13 at 11:53

Not the answer you're looking for? Browse other questions tagged or ask your own question.