Installing and Running MongoDB on OSX

前端 未结 10 1361
醉话见心
醉话见心 2020-12-02 05:21

If someone can provide some insights here I would GREATLY appreciate it.

I am new to MongoDB, and (relatively) new to the command line.

I had a express/nod

10条回答
  •  借酒劲吻你
    2020-12-02 06:14

    Mac Installation:

    1. Install brew

      ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
      
    2. Update and verify you are good with

      brew update
      brew doctor
      
    3. Install mongodb with

      brew install mongodb
      
    4. Create folder for mongo data files:

      mkdir -p /data/db
      
    5. Set permissions

      sudo chown -R `id -un` /data/db
      
    6. Open another terminal window & run and keep running a mongo server/daemon

      mongod
      
    7. Return to previous terminal and run a mongodb shell to access data

      mongo
      

    To quit each of these later:

    1. The Shell:

      quit()
      
    2. The Server

      ctrl-c
      

提交回复
热议问题