MongoDB installed via Homebrew not working

前端 未结 5 928
迷失自我
迷失自我 2021-02-19 21:55

I installed MongoDB via Homebrew (following http://docs.mongodb.org/manual/tutorial/install-mongodb-on-os-x/) but it\'s not working.

Typing mongod at shell

5条回答
  •  我在风中等你
    2021-02-19 22:35

    It works from the directory since the sh searches the ENV path and then the cwd for a program named mongod. I have been looking around a little and it seems that the default install of MongoDB (I am not a Mac user) does not install a rc or init script for which sh to understand it's running behaviour as stated here:

    http://docs.mongodb.org/manual/tutorial/install-mongodb-on-os-x/#using-mongodb-from-homebrew-and-macports

    The packages installed with Homebrew and MacPorts contain no control scripts or interaction with the system’s process manager.

    If you have configured Homebrew and MacPorts correctly, including setting your PATH, the MongoDB applications and utilities will be accessible from the system shell. Start the mongod process in a terminal (for testing or development) or using a process management tool.

    So you must actually define (as you said) MongoDBs path, here is an example: https://snipt.net/sido/installing-mongodb-on-os-x/

    Edit: the example is not mine. I just stole it from it's user: https://snipt.net/sido/

提交回复
热议问题