I'm trying to connect to an mlab database, but when I run the command
mongodb://ds119508.mlab.com:19508/myDb -u myUser -p myPass
It always prompts this message:
MongoDB shell version v3.4.0 connecting to: mongodb://ds119508.mlab.com:19508/heroku_xnz5tw94 MongoDB server version: 3.2.11 WARNING: shell and server versions do not match
I'd like to get rid of that. I'm sure I've been installing the 3.4
version by using this guide
Thanks in advance for help.
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.
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.
mongorc. js File. When starting, mongo checks the user's HOME directory for a JavaScript file named .
I have also encountered with this problem. And it was caused by upgrading mongodb without shutting mongo server down.
Now that you've already have the new version of mongodb (tell from the mongo shell version). You can solve it by just restarting the mongod
process.
For starting and stopping mongo process, see https://docs.mongodb.com/manual/tutorial/manage-mongodb-processes
There are probably multiple mongodb versions installed in your machine. I had a similar problem (I uninstalled the old version but not completely) and I followed this link (https://medium.com/@rajanmaharjan/uninstall-mongodb-macos-completely-d2a6d6c163f9) to uninstall all versions of mongodb and reinstall the most updated version and it worked.
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