Mongo is unable to start

后端 未结 9 946
故里飘歌
故里飘歌 2020-12-28 08:58

I\'m trying to start mongo uin windows10 by type: mongo in cmd.

I am getting this error:

C:\\Users\\Itzik>mongo
MongoDB shell versio         


        
相关标签:
9条回答
  • 2020-12-28 09:45

    In C:\Program Files\MongoDB\ you might not have permission to create file/folder for your user. And mongo installer cannot create it because of lack of Administrative permission for your user.

    So in C:\Program Files\MongoDB:

    1. Create a folder named data
    2. Create a folder named db inside the folder data
    3. Now right click on the data folder and choose properties
    4. Click security tab and select your user there
    5. Click the Full control select box
    6. Click ok, ok, ok ...
    7. important! if you don't have the path "C:\Program Files\MongoDB\Server\3.4\bin" set in environment variable, please set it.
    8. Now go to shell and type : mongod --dbpath "C:\Program Files\MongoDB\data\db"

    That's it :)

    0 讨论(0)
  • 2020-12-28 09:45

    This issue is resolved by creating a data directory

    Then move to the bin folder of mongodb or setting path information in environment variables

    Then you can enter the following command,

    mongod --dbpath 'path of the data folder including data directory name'

    Eg: mongod --dbpath c:\users\codemaker\data

    0 讨论(0)
  • 2020-12-28 09:46
    1. Open the terminal as Administrator.

      (You can simply do this by searching cmd in start and then right click and select "Run as administrator")

    2. Go to bin directory of your MongoDB folder.

      cd C:\Program Files\MongoDB\Server\3.4\bin

    3. Type following command to start mongodb server :

      mongod --dbpath "C:\Program Files\MongoDB\Server\3.4\bin\Data"

      now, server will be waiting for connections.

    4. Open a new command prompt(again as Administrator)

    5. Go to bin directory.

      cd C:\Program Files\MongoDB\Server\3.4\bin

    6. Type following command:

      mongo

    This will show you a prompt of mongodb :

      >
    

    Thanks.

    0 讨论(0)
提交回复
热议问题