Read-only file system when attempting mkdir /data/db on Mac

后端 未结 16 2119
予麋鹿
予麋鹿 2020-12-07 10:28

I am trying to create a new folder in the main directory

Tried all kinds of examples

sudo mkdir /data/db

sudo mkdir -p /data/db<

16条回答
  •  悲&欢浪女
    2020-12-07 11:06

    To add on to what David Buck wrote here, first you have to actually make the directory. You can do that with:

    sudo mkdir /System/Volumes/Data/data/db

    If you're getting this error:

    "Error parsing command line: unrecognised option '--dbpath/System/Volumes/Data/data/db' try 'mongod --help' for more information"

    after creating the alias, it's just because David Buck (while making a really helpful comment) missed a space in his answer.

    To fix this, type

    unalias mongod

    and then type

    alias mongod="sudo mongod --dbpath /System/Volumes/Data/data/db"

提交回复
热议问题