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

后端 未结 16 2080
予麋鹿
予麋鹿 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 10:53

    I create a gist with simple steps to install and run mongodb on catalina

    # install homebrew (https://brew.sh/) and run the following commands
    sudo chown -R $(whoami) $(brew --prefix)/*
    brew tap mongodb/brew
    brew install mongodb-community@4.2
    
    ## --- aliases to set in your zshrc file
    
    # open your zshrc file
    open ~/.zshrc
    # copy and paste shorcuts in the end of the file
    alias mongod='brew services run mongodb-community'
    alias mongod-start='brew services start mongodb-community' #will start MongoDB automatically when you login into your Macbook
    alias mongod-status='brew services list'
    alias mongod-stop='brew services stop mongodb-community'
    
    # restart your terminal
    # type mongod in your terminal for run service & mongod-stop for finish it
    # test your mongodb connection with
    mongo
    show dbs
    

    https://gist.github.com/sturmenta/cf19baa91b1d79d8ae2b305fb7e1f799

提交回复
热议问题