简体   繁体   中英

Failed to start of service MongoDB using Homebrew in Mac OS Mojave 10.14

I installed/reinstall the mongoDB couple times. But I am getting same problem " error : permission denied"

I am using the community@4.2 edition.

I have many ways after reading suggestions in stack overflow. but nothing worked.

I have installed following the instruction from mongoDB: https://docs.mongodb.com/manual/tutorial/install-mongodb-on-os-x/

The services doesn't start. how to config the username and password using config I am not sure.

while installing from brew it did not ask for config any password or username.

brew services start mongodb-community@4.2

error message while starting the mongoDB service. Error: Permission denied @ rb_sysopen - /Users/syedahmed/Library/LaunchAgents/homebrew.mxcl.mongodb-community.plist

  • Open the Terminal app and type

brew update.

  • After updating Homebrew

brew install mongodb

  • After downloading Mongo, create the “db” directory. This is where the Mongo data files will live. You can create the directory in the default location by running

mkdir -p /data/db

  • Make sure that the /data/db directory has the right permissions by running

> sudo chown -R `id -un` /data/db

  • Run the Mongo daemon, in one of your terminal windows run mongod. This should start the Mongo server.

  • Run the Mongo shell, with the Mongo daemon running in one terminal, type mongo in another terminal window. This will run the Mongo shell which is an application to access data in MongoDB.

  • To exit the Mongo shell run quit()

  • To stop the Mongo daemon hit ctrl-c

if you are having any trouble visit

https://treehouse.github.io/installation-guides/mac/mongo-mac.html

it the same thing you will see here , but just look at the fresh doc 😂

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM