I have a Mac running 10.8.2 and just installed mongodb running the brew install mongodb
command. Everything seemed to be installed correctly. However when I run mongo
to enter the shell I get the following error:
Alexander-Burgos-Collazos-MacBook:~ Alexander$ mongo
MongoDB shell version: 2.2.3
connecting to: test
Wed Feb 6 19:44:59 Error: couldn't connect to server 127.0.0.1:27017 src/mongo/shell/mongo.js:91
exception: connect failed
I followed some threads around here but never got a clear and concise answer as to how to fix it. I entered mongod
in the command terminal and it returned:
all output going to: /usr/local/var/log/mongodb/mongo.log
From there on everything I input does not return anything. I am confused as to how this really works.
May be mongod not started.
For start manually use command:
/usr/local/opt/mongodb/mongod run --config /usr/local/etc/mongod.conf
But brew has a lanchctl plist. You can run this command and mongodb launch at login:
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mongodb.plist
More about brew version mongodb:
brew info mongodb
More about mongod you can read in manual.
Latest versions of Brew supports
brew services start mongodb
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