Got "Access is denied" when I tried to install 64-bit mongodb in Windows server 2008
Asked Answered
L

2

14

All I did is to run below script: D:\Tools\MongoDb\bin\mongod.exe --dbpath D:\MongoDb\data\

Then I got exception: Error connecting to the service Control Manager: Access is denied. (5)

I was using administrator account to operate this, I already created folders related to the script.

And I didn't experience issue like this when I installed 32-bit mongodb in 32-bit Windows Server 2003.

I appreciate any help about this!

Lollard answered 4/11, 2010 at 16:32 Comment(0)
R
41

You need to install it from the command prompt that you have opened with the Run as Administrator option

Radiant answered 4/11, 2010 at 16:39 Comment(3)
Just in case if anyone wondering how to start command prompt as Run as Administrator,kindly follow below steps :- 1. Click Start, click All Programs, and then click Accessories. 2. Right-click Command prompt, and then click Run as administrator. 3. If the User Account Control dialog box appears, confirm that the action it displays is what you want, and then click Continue. Taken from this linkTy
Many websites and manuals indicate that running "cmd" with Ctrl + Shift + Enter run as administrator but does not work at least I will not work for me with Win10, to verify that you are running the cmd as administrator in the title window should say 'Administrator: cmd.exe', otherwise if you get error 'journal' added to the command line --nojournalAdamok
This answer does not work and was an obvious first attempt at resolving my issue. In WIN11, received the message "This app can't run on your PC. To find a version for your PC, check with the software publisher"Judgment
W
0

From Admin command prompt execute:

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Windows\system32>cd C:\Program Files\MongoDB\Server\3.6\bin

C:\Program Files\MongoDB\Server\3.6\bin>mongod.exe -config "c:\data\mongod.cfg" -install
2018-03-20T08:55:00.541+0530 I CONTROL  [main] log file "c:\data\log\mongod.log"
 exists; moved to "c:\data\log\mongod.log.2018-03-20T03-25-00".

C:\Program Files\MongoDB\Server\3.6\bin>net start MongoDB
The MongoDB service is starting..
The MongoDB service was started successfully.
Whitnell answered 21/3, 2018 at 2:11 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.