When ever I try to connect to mongo db I always get this error as below.
MongoDB shell version: 2.4.3 connecting to: test Fri Apr 26 14:31:46.941 JavaScript execution f
Same error here, this worked for me:
sudo mongod --repair
followed by
sudo mongod
(forget about service and start)
Then on a different tab/terminal:
mongo
If you create data\db
folder, firstly you must delete this folder then execute:
c:\mongodb\bin\mongo.exe
If you are on unix-like systems.
Starting in MongoDB 4.4, a startup error is generated if the ulimit value for number of open files is under 64000. View the current val
$ ulimit -n
Change value
$ ulimit -n <val>
I had the same issue until i close teamviewer
running on my pc. Then it worked fine!
Quick Fix: I have the same problem to start the MongoDB and it was
easily fixed by running the file mongod.exe
(C:\Program Files\MongoDB\Server\3.2\bin
) then run the file mongo.exe
(C:\Program Files\MongoDB\Server\3.2\bin
)..Problem fixed
mongod --configsvr --smallfiles --nojournal --dbpath cfg/1 --port 26052 --fork --logpath cfg/3.log >/dev/null
sleep 2000
mongos --configdb ${HOSTNAME}:26050,${HOSTNAME}:26051,${HOSTNAME}:26052 --fork --logpath mongos.log >/dev/null
Sleep for some time before starting the mongos you will not face the problem