when i setup mongodb in my ubuntu , i try : ./mongo it show this error :
couldn't connect to server 127.0.0.1 shell/mongo.js
so what can i do ,
thanks
These are some of the solutions: Ensure that your MongoDB instance is running: Compass must connect to a running MongoDB instance. Also check you have installed MongoDB and have a running mongod process. You should also check that the port where MongoDB is running matches the port you provide in the compass connect.
Normally this caused because you didn't start mongod process before you try starting mongo shell. This case worked out for me, i had to do ~>sudo mongod --dbpath /dbpathlocation and then opened the new terminal to run mongo...
To open up the MongoDB shell, run the mongo command from your server prompt. By default, the mongo command opens a shell connected to a locally-installed MongoDB instance running on port 27017 . Try running the mongo command with no additional parameters: mongo.
sudo rm /var/lib/mongodb/mongod.lock
sudo -u mongodb mongod -f /etc/mongodb.conf --repair
Please note the following:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With