0
votes

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!

1
You need to give exclusive permissions to the created folder. Also try deleting the mongod.lock file manually and then start the service.BatScream
@BatScream, can you give me a terminal command to do that?diwao11
chmod -R 777 /path/to/your/folder will do fine for developmentmartskins

1 Answers

0
votes

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

sudo chown $USER /data/db