Installing MongoDB with Homebrew

后端 未结 4 403
梦谈多话
梦谈多话 2020-12-07 11:24

I\'m relatively new to MongoDB and am trying to install MongoDB on my Mac with Homebrew, but I\'m getting the following error:

Error: No available formula wi         


        
相关标签:
4条回答
  • 2020-12-07 12:01

    Try this code in your terminal:

    /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" 
    

    And then:

    brew tap mongodb/brew  
    

    Finally:

    brew install mongodb-community@4.0
    
    0 讨论(0)
  • 2020-12-07 12:16

    first install mongoldb

    brew tap mongodb/brew
    

    Secondly install using this command. mangodb successfully installed

    brew install mongodb-community@4.0 
    

    You will get the output

    ==> CaveatsTo have launchd start mongodb/brew/mongodb-community now and restart at login:
      brew services start mongodb/brew/mongodb-community
    Or, if you don't want/need a background service you can just run:
      mongod --config /usr/local/etc/mongod.conf
    ==> Summary
                                                                        
    0 讨论(0)
  • 2020-12-07 12:16

    In MacOs Catalina doesn't work properly for me.

    After the installation (https://zellwk.com/blog/install-mongodb/) i had to add permission to "/tmp/mongodb-27017.sock"

    sudo chown -R `id -un` /tmp/mongodb-27017.sock
    

    and the command "mongod" seems to ignore the config file (mongod.conf) in "/usr/local/etc" so i have to always launch it with the dbpath argument

    mongod --dbpath /usr/local/var/mongodb
    

    even if the same path is specified in the config file.

    Also using "mongod" with configuration file doesn't work for me

    mongod -f /usr/local/etc/mongod.conf
    

    or

    mongod --config /usr/local/etc/mongod.conf
    

    I solved all these issues starting the mongodb via brew services. That worked well without issues and takes the parameters from the right configuration file.

    brew services run mongodb-community
    
    0 讨论(0)
  • 2020-12-07 12:24

    Formula mongodb has been removed from homebrew-core. Check pr-43770 from homebrew-core

    To our users: if you came here because mongodb stopped working for you, we have removed it from the Homebrew core formulas since it was migrated to a non open-source license.

    Fortunately, the team of mongodb is maintaining a custom Homebrew tap. You can uninstall the old mongodb and reinstall the new one from the new tap.

    brew services stop mongodb
    brew uninstall mongodb
    
    brew tap mongodb/brew
    brew install mongodb-community
    brew services start mongodb-community
    

    Check mongodb/homebrew-brew for more info.

    0 讨论(0)
提交回复
热议问题