Service 'MongoDB Server'(MongoDB) failed to start.Verify that you have sufficient privileges to start system services

时光怂恿深爱的人放手 提交于 2020-08-02 07:26:19

问题


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

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


回答1:


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.




回答2:


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




回答3:


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/




回答4:


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.




回答5:


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.




回答6:


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



回答7:


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!




回答8:


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

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

and it successfully installed.




回答9:


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!!!




回答10:


  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...



回答11:


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




回答12:


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

  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!




回答13:


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



来源:https://stackoverflow.com/questions/52877759/service-mongodb-servermongodb-failed-to-start-verify-that-you-have-sufficien

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!