install mongodb on window 8

16,192

Solution 1

thanks for answer Moacy Barros but problem was not for this because i run all commands in Command Prompt with “Administrative Privileges:”" problem was for mongod.cfg if mongod.cfg config by manual in editor this problem solve that we didn't need to do this in window 7 or server 2008

Edit::

in older windows when installing MongoDB < 2.2 that i was tested. in Configure directories and files step

echo logpath="C:\Program Files\MongoDB\log\mongo.log" > "C:\Program Files\MongoDB\mongod.cfg"

it make mongod.cfg for your mongodb but it wasn't make for me in window 8 for that i make it by manual like

logpath=C:\mongodb\log\mongo.log 
logappend=true
dbpath = E:\data

Solution 2

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

Solution 3

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/

Solution 4

error message suggest you don't have admin privileges.

"Run all of the following commands in Command Prompt with “Administrative Privileges:”"

Ref: http://docs.mongodb.org/manual/tutorial/install-mongodb-on-windows/#install-and-run-the-mongodb-service

Regards, Moacy

Share:
16,192

Related videos on Youtube

mohammad mohsenipur
Author by

mohammad mohsenipur

Updated on September 15, 2022

Comments

  • mohammad mohsenipur
    mohammad mohsenipur over 1 year

    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?

    • Sammaye
      Sammaye about 11 years
      Are you sure you have administrator privileges on the system?
    • ppeterka
      ppeterka
      I think this question might be a better fit in superuser.stackexchange.com