I've installed mongodb with brew on my Mac OSX Sierra 10.12.6:
brew install mongodb
I get no errors when running:
brew services start mongodb
but when i try to run:
mongo
I get the following error:
MongoDB shell version v3.6.2
connecting to: mongodb://127.0.0.1:27017
2018-02-05T14:55:25.952-0500 W NETWORK [thread1] Failed to connect to 127.0.0.1:27017, in(checking socket for error after poll), reason: Connection refused
2018-02-05T14:55:25.952-0500 E QUERY [thread1] Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed :
connect@src/mongo/shell/mongo.js:251:13
@(connect):1:6
exception: connect failed
I've removed the .plist files, made sure that /data/db is there and all necessary permissions are on it. I can start mongodb
without a problem and everything runs but I cannot get it to run with brew services start mongodb
Any ideas why?
Go to the MongoDB website's download section and download the correct version of MongoDB. Run the Mongo daemon, in one terminal window run ~/mongodb/bin/mongod . This will start the Mongo server. Run the Mongo shell, with the Mongo daemon running in one terminal, type ~/mongodb/bin/mongo in another terminal window.
If you don't need to keep your current data:
brew services stop mongodb
brew uninstall mongodb
rm -rf /usr/local/var/mongodb/
rm -rf ~/Library/LaunchAgents/homebrew.mxcl.mongodb.plist
rm -rf /usr/local/etc/mongod.conf
brew install mongodb
brew services start mongodb
should upgrade to the newest version and start it.
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