Mongod: Command Not Found (OS X)

前端 未结 9 984
情深已故
情深已故 2020-12-14 17:08

I am trying to test MongoDB and I have it all downloaded and moved into the root folder. I can navigate to the folder that holds the mongod, but when I try to run it by typi

9条回答
  •  清歌不尽
    2020-12-14 17:51

    3 steps:

    Step 1:

    export PATH="$PATH:/usr/local/mongodb/bin"
    

    OR

    export PATH="$PATH:/usr/local/opt/mongodb@3.2/bin"
    

    (replace version number with your local version)

    The first step will allow you to run the command, but will get you another error: "/data/db does not exit" so you have to

    Step 2 :

    sudo mkdir -p /data/db
    

    Now /data/db is read only, but it has to be writable also so

    Step 3 :

    sudo chown -R USERNAME /data/db 
    

提交回复
热议问题