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
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!
Open task manager, click on the services tabs on the top. From the list right click on mongoDB then click start.
I got this error beacuse of not sufficient space in the disk. Check your mongo log.
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.
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.
I got this problem. What fixed mine is:
"C:\mongo_databse"
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.
Now open ANOTHER command prompt then type in mongo
then it works.