Skip to content

Instantly share code, notes, and snippets.

@skippednote
Last active December 13, 2015 18:08
Show Gist options
  • Save skippednote/4952556 to your computer and use it in GitHub Desktop.
Save skippednote/4952556 to your computer and use it in GitHub Desktop.

So I installed MongoDB using brew without any issue. However when I run mongo I get this error

MongoDB shell version: 2.2.3
connecting to: test
Thu Feb 14 18:20:49 Error: couldn't connect to server 127.0.0.1:27017 src/mongo/shell/mongo.js:91
exception: connect failed
@skippednote
Copy link
Author

Ran mongo in one window and mongod in another but got this error

/usr/local/bin/mongod:3: warning: Insecure world writable dir /usr/local/Cellar in PATH, mode 040777
all output going to: /usr/local/var/log/mongodb/mongo.log

@jackfranklin
Copy link

Mongo is actually running completely fine there - you should still be able to run mongo and connect to your local instance.

That warning (note, it's a warning, not an error) says that permissions on /usr/local/Cellar are wrong, you've got it set as 777 which you don't want to do. If you google "insecure world writable dir", there's useful responses there to help you.

@skippednote
Copy link
Author

Changed the permissions on usr/local/Cellar to go-w and mongo works fine now. Thanks @jackfranklin

@skippednote
Copy link
Author

sudo chmod -R o-w /usr/local/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment