mkdir: /data: Read-only file system

Viewed 40

I installed mongodb

using these instructions:

https://github.com/mongodb/homebrew-brew

However, I cannot connect to a mongo shell when I run mongo.

How do I connect to the mongo shell?

I was made aware of mongosh, when I run the mongosh command after installing it, I get connect ECONNREFUSED.

When I run a ps -ef | grep mongod | grep -v grep | wc -l | tr -d '' it shows zero process is running, which would logically explain why I cannot connect, but then what do I do when I run brew services start mongodb-community and it says its starts but zero process when I look into it.

I don't know if sudo mkdir -p /data/db is what is missing for this to run correctly, but when I attempt to run that step, I get mkdir: /data: Read-only file system.

So I placed the directory in /Users/<username>/data/db and then ran mongod --dbpath=/Users/<username>/data/db and nothing.

0 Answers
Related