0

I just downloaded mongodb via homebrew. When I tried starting it by mongod it said that I didn't have the data/db folder for it. I made the folder via sudo command from another stackoverflow page. Now the error that I'm getting is:

exception in initAndListen: 10309 Unable to create/open lock file: /data/db/mongod.lock errno:13 Permission denied Is a mongod instance already running?, terminating

I'm not sure why it's asking me if another instance of mongod is running because I only have one bash shell open.

Any tips would be awesome. Thank you!

diwao11
  • 151
  • 2
  • 15
  • You need to give exclusive permissions to the created folder. Also try deleting the `mongod.lock` file manually and then start the service. – BatScream Feb 13 '15 at 18:13
  • @BatScream, can you give me a terminal command to do that? – diwao11 Feb 13 '15 at 18:22
  • `chmod -R 777 /path/to/your/folder` will do fine for development – martskins Feb 13 '15 at 18:57
  • possible duplicate of [mongodb Mongod complains that there is no /data/db folder](http://stackoverflow.com/questions/7948789/mongodb-mongod-complains-that-there-is-no-data-db-folder) – BatScream Feb 13 '15 at 19:05

1 Answers1

0

Okay, I figured it out. The command after sudo mkdir -p /data/db is

sudo chown $USER /data/db

diwao11
  • 151
  • 2
  • 15
  • Here's the stackoverflow that I used to help me. http://stackoverflow.com/questions/7948789/mongodb-mongod-complains-that-there-is-no-data-db-folder – diwao11 Feb 13 '15 at 18:56