MongoDB on a Windows 7 machine: No connection could be made

前端 未结 14 1681
渐次进展
渐次进展 2020-12-02 10:39

After I have started Mongo using mongod.exe on a Windows 7 machine, I tried to start the mongo shell that failed with the error:

Failed to connect to

相关标签:
14条回答
  • 2020-12-02 11:08

    it prompted me like this

    1)So, i created a path

    C:\data\db

    2)Now run

    mongod in your terminal

    it solved me issue!

    0 讨论(0)
  • 2020-12-02 11:12

    Open task manager, click on the services tabs on the top. From the list right click on mongoDB then click start.

    0 讨论(0)
  • 2020-12-02 11:15

    I got this error beacuse of not sufficient space in the disk. Check your mongo log.

    0 讨论(0)
  • 2020-12-02 11:16

    I am not sure if there is a better way to run it. For me, I use these settings to create a directory and to a determinate new path for the MongoDB. The important thing for me is that I miss to run it as a server (mongod) and after that into another terminal I type mongo which provide me an option to use the database. I hope this could help someone.

    0 讨论(0)
  • 2020-12-02 11:20

    I got the same error and fixed it with:

    1) mkdir c:\data

    2) cd data

    3) mongod -dbpath .

    4) Now in another command window I was able to connect from my client using the mongo command.

    0 讨论(0)
  • 2020-12-02 11:20

    I got this problem. What fixed mine is:

    1. Suppose you have a dir: "C:\mongo_databse"
    2. Open Command Prompt and type (suppose you haved added the Mongo bin directory to PATH): mongod --dbpath=C:/mongo_database. There will be some log to the command prompt.

    3. Now open ANOTHER command prompt then type in mongo then it works.

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