0
votes

I am getting the following error message when I try to connect MongoDB in mac

MongoDB shell version v3.4.9 connecting to: mongodb://127.0.0.1:27017 2017-11-27T12:27:26.105+0530 W NETWORK [thread1] Failed to connect to 127.0.0.1:27017, in(checking socket for error after poll), reason: Connection refused 2017-11-27T12:27:26.141+0530 E QUERY [thread1] Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed : connect@src/mongo/shell/mongo.js:237:13 @(connect):1:6 exception: connect failed

1
I resolved the error. "Attempted to create a lock file on a read-only directory: /data/db, terminating" This was in read only form. I changed that giving > sudo chown -R $USER /data/dbAarthi Ananth
You can post the answer . about how you have resolved your problemDeep Kakkar

1 Answers

0
votes
sudo service mongod start
mongo