4
votes

When I try to start mongo db I get the following error:

Trying to run the command : ./mongod --dbpath=../data
Failed to unlink socket file /tmp/mongodb-27017.sock errno:13 Permission denied
Fatal Assertion 28578

As per the suggestions from other posts, have tried to locate the file /tmp/mongodb-27017.sock, to delete. But the file itself is not available.

But when I tried to do it using root, I am able to start the mongo DB. For normal users it fails.

Version used: mongodb-osx-x86_64-3.0.2

2

2 Answers

11
votes

Remove file

/tmp/mongodb-27017.sock

/dbpath/mongod.lock

try start with any user not root user.

4
votes

Current user does not have permissions to delete that file.

Grant permissions to the current user:

sudo chown `whoami` /tmp/mongodb-27017.sock