I apologize if this has somehow been answered. But, I have been stuck on this for awhile now to the point where I am losing hope in using a local server (MongoDB). I am also a person simply learning all of this, so please forgive me if I am asking a "noob" question.
Setup: MacOS using iTerm, using brew.
Problem:
Was able to use MongoDB fine when I was using the bash shell. No problems at all.
Issue:
macOS forced me to switch to zsh
shell and now, I can't run it.
The error message shows that I do not have the directory /data/db
. I saw that others had the same problem.
What I have already tried:
- reinstalling brew
- reinstalling MongoDB
mkdir -p /data/db
- switching path to the said directory
None seem to work. In fact, when I try to make /data/db
, it states that it is a read-only file as follows.
after running mkdir -p /data/db
Please help me :(