Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

install mongodb on window 8

I try to install mongodb on window 8 .

problem is when i want to install mongodb service

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

below error accord

 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 Mongodb Service?

like image 816
mohammad mohsenipur Avatar asked Dec 04 '22 00:12

mohammad mohsenipur


2 Answers

Open Command with "Run as Administrator",that solved my problem

like image 102
Shreekant N Avatar answered Dec 12 '22 06:12

Shreekant N


For anyone that happens to try to create a mongodb service on Windows 8 and follows the instructions on MongoDB's website AND still is unable to create the service successfully - I've written this post that explains how I got it to work after experiencing problems trying to set the mongo service on my Windows 8 laptop. Hope it helps!

Here are the steps that you really need to follow to create a Windows service for MongoDB in Windows 8:

Installing MongoDB on Windows 8

  1. Download and install MongoDB. You can download the 32 or 64-bit version from here.
  2. Make sure you install MongoDB in a folder that you can easily remember, for example: c:\mongodb\
  3. Add directories c:\mongodb\log and c:\mongodb\data
  4. Add log file c:\mongodb\log\mongo.log

Creating a Windows service for MongoDB

  1. Open your command window and type the following:

    cd c:\mongodb\bin\mongod.exe --install --rest -master -logpath=c:\mongodb\log\mongo.log

  2. Open the registry settings, press the Windows key and R at the same time and then type regedit in the Run command window.

  3. Go to HKEY_LOCAL_MACHINE >> SYSTEM >> CurrentControlSet >> services

  4. Find out MongoDB directory & edit ImagePath key Set key value as:

    C:\mongodb\bin\mongod --service --rest --master --logpath=C:\mongodb\logs\mongo.log --dbpath=C:\mongodb\data

  5. Save and exit registry editor.

  6. Open Services by pressing the Windows key and R at the same time and then type services.msc in the Run command window and click OK.

  7. Find the MongoDB service and right-click on it, select Properties

  8. Make sure the service is set to start automatically and start the service as shown below.

enter image description here

  1. Open your browser and go to http://localhost:28017/ to see if MongoDB is running correctly, you should see a page full of MongoDB details.

Link to this blog post: http://ricardodsanchez.com/2014/09/03/install-mongodb-service-on-windows-8/

like image 29
Ricardo Sanchez Avatar answered Dec 12 '22 04:12

Ricardo Sanchez