12

When I'm trying to install MongoDB Community edition on windows 8.1, I'm getting below error.

enter image description here

I tried most of the available solution from the internet but none of them worked.

James Z
  • 12,209
  • 10
  • 24
  • 44
Vilas D.
  • 165
  • 1
  • 3
  • 12
  • What do the (windows) logs say? and do you actually have permissions to start the service? – user3788685 Oct 18 '18 at 18:14
  • Have you tried running the installer as administrator (right-click on the installer and select the option that appears in the context menu)? When you run a program (including an installer), the program typically doesn't run with administrator privileges. Since MongoDB wants to create a service, it would need administrator-level privileges to do that. Please try going that route and let us know whether or not that resolves your problem. – B. Fleming Oct 18 '18 at 18:26
  • @B.Fleming I tried it running as adminstrator, but did not work. – Vilas D. Oct 19 '18 at 05:00
  • Please review the software requirements section of the installation documentation. Note that you're required to have your version of Windows updated, otherwise you may run into problems. Please review the remaining requirements and ensure that everything is met: https://docs.mongodb.com/manual/tutorial/install-mongodb-on-windows/#software-requirements. Follow the installation instructions closely. Let's thoroughly eliminate the possibility of a problem with early steps before continuing with further troubleshooting. – B. Fleming Oct 19 '18 at 05:37
  • @B.Fleming Now i installed mongodb 3.6 and its running fine. Thank you very much for the response. – Vilas D. Oct 19 '18 at 07:13
  • @vilas D I am facing the same problem can you tell be how did you overcome from it. – Abhishek-Saini Aug 01 '19 at 01:03
  • Welcome to SO! Please don't use images. See "[Discourage screenshots of code and/or errors](https://meta.stackoverflow.com/questions/303812)" for a discussion why. – the Tin Man Feb 17 '20 at 21:14

16 Answers16

12

I resolved this issue by installing Microsoft Visual C++ Redistributable 2019.

You can download it from the link below.

https://www.itechtics.com/microsoft-visual-c-redistributable-versions-direct-download-links/

ax1o
  • 161
  • 2
  • 4
5

In my case, I was changing the path in which the data and log folders were stored and the installer was not intelligent enough to auto-create the target paths. So after manually creating each set of folders and restarting the installation, version 4.0.10 installed without error.

sean2078
  • 5,131
  • 6
  • 32
  • 32
4

I grappled with the same issue for a while until I realized that my problem is the installation location. You are most likely to run into this error if you install MongoDb in this folder: C:\MongoDB. I resolved it by installing in the default folder which is C:\Program Files\MongoDB\Server\4.0\bin

Pholoso Mams
  • 467
  • 1
  • 5
  • 19
3

I had the same problem!

Probably you're trying to install MongoDB in a custom folder.(for ex. C:\mongodb)

Don't do that!

  1. Let the setup program install mongoDB on the default Program Path.(Usual path -> C:\Program Files\MongoDB\Server\4.2)

  2. After you've installed it, you can copy the content of these folder and past it to your intended custom folder. (In this example -> C:\mongodb)

  3. After you've done this you shouldn't get any more errors when you start mongo on a command shell.

3

Ten hours of work, nothing from above work for me except the following:

  1. make your custom directory for instance C:\mongodb
  2. give full access permission by right click it, properties at security widget for all groups and users.
  3. inside make catalog data and inside it catalog db
  4. install MongoDB with msi installer, select custom and select the created directory C:\mongodb as installation path.
  5. When at installation you receive the mentioned error, select Ignore.
  6. Run command prompt at C:\mongodb\bin as administrator and input mongod. You'll see that it was interrupted.
  7. Remove current MongoDB service by executing mongod --remove.
  8. Execute the following: mongod --directoryperdb --dbpath C:\mongodb\data\db --logpath C:\mongodb\log\mongo.log --install
  9. Execute net start MongoDB to verify it works correctly
  10. Enjoy
1

Goto "C:\mongodb\bin" and Open "mongod.cfg", Then Search for :#mp

Just remove the text :#mp from the file (you will find :#mp where the content of the file ends).

Now Run : net start mongodb. This should work now.

1

I had been struggling for the same, a whole day finally came up with this solution. I have window 8.1...

enter image description here

  1. when this screen pops up! click 'ignore' here(it will close)
  2. open 'View Advanced System Settings'(search for it in win menu).
  3. In 'Advance' tab at the bottom, Click 'Environment Variables', open that.
  4. Now look for path variable in system variable and the other, Select path variable and click edit.
  5. Now at the end of variable add the following...

...initialText;path where path is the where your MongoDB was installed with the bin folder in the same. By default its C:\Program Files\MongoDB\Server\4.2(your version)\bin

edit like this initialText;C:\Program Files\MongoDB\Server\4.2\bin click ok close.

Try running mongod in cmd prompt it will show an error and will close. Error will say to create a folder C:\data\db manually. Do it.

You're all set try running 'mongod' again.

You're welcome!

0

Look here, this is the right solution. In windows, open the service program and look at the properties of the mongodb service (for me it is "E:\mongodb\bin\mongod.exe --config "E:\mongodb\bin\mongod.cfg" -- Service"), copy this attribute to cmd and execute it manually. You will find that it is reporting an error. The error message is that "mp" is not recognized. So we only need to comment out the "mp" in the mongod.cfg file. If you don't choose a custom installation path, there is no "mp" in mongod.cfg, which is a weird bug!

0

I rebooted my computer and chose the default path when installing:

C:\Program Files\MongoDB\Server\4.2\bin

and it successfully installed.

Das_Geek
  • 2,775
  • 7
  • 20
  • 26
Raja M
  • 1
0

Go to the bin folder of the mongodb and open a command prompt or git bash there. Enter the command: ./mongod --repair

This will run and you will get to know the exact error. In my case: MongoDb is fetching db folder in F:\data\db but my setting is F:\mongodb\data\db

Error which I got while installing mongodb in custom folder So I changed the path of db with a command:

./mongod --dbpath F:\mongodb\data\db

If above command didn't work, use double backslashes

./mongod --dbpath F:\\mongodb\\data\\db

And BRAVO!!!

Suman Mali
  • 31
  • 1
  • 5
0
  1. Just open CMD as Admin Mode.
  2. change the path with cd. /path to the folder in which you have downloaded the setup of MongoDB.
  3. open setup by typing its name in cmd.
  4. Install program as usual in any folder you want! Cheers...
0

if you installing in the lower version of Windows-10 then you need to install these file before Installing MongoDB 4.2.6.

  1. install Update for Windows 8 for x64-based Systems (KB2999226) from https://www.microsoft.com/en-us/download/details.aspx?id=49082

after this installation

  1. Install the MongoDB

Install successfully

0

Installing mongodb from the Windows command prompt/interpreter (cmd.exe) using msiexec.exe worked for me.

msiexec.exe /l*v mdbinstall.log  /qb /i mongodb-windows-x86_64-4.4.1-signed.msi ^
            ADDLOCAL="ServerService,Client" ^
            SHOULD_INSTALL_COMPASS="0"

https://docs.mongodb.com/manual/tutorial/install-mongodb-on-windows-unattended/#procedure

was_777
  • 599
  • 1
  • 9
  • 28
0

I had the same problem so I created a repo C:\mongodb , when I did the installation the same window appeared again and I just clicked on "ignore", I don't know how but it worked for me everything is installed :) .

0

I faced the same issue. After ignoring this warning, and trying to start the server, got a specific error message related to VCRUNTIME140_1.dll. I found sufficient privilege message misleading! To fix the issue related to VCRUNTIME140_1.dll, found this video very useful - https://www.youtube.com/watch?v=wGLK26Kk9bE

Below are the steps mentioned in that video -

  1. Download DLL from https://www.dll-files.com/vcruntime140_1.dll.html
  2. Copy this DLL to C:\Windows\System32 for 32 bit and C:\Windows\SysWOW64 for 64 bit

After copying the DLL, issue got resolved.

Guru
  • 964
  • 9
  • 12
-2

I have temporarily solved this issue by downgrading to a previous version of MongoDB: 3.6.13.

S.S. Anne
  • 15,171
  • 8
  • 38
  • 76
RUGVED
  • 174
  • 3
  • 3