Installing MongoDB on a mac

1. Install “HomeBrew”: http://brew.sh
2. Go to mongoDB install page and follow the instructions for installing the binaries using homeBrew. I did the following:
brew install mongodb

3. Execute the command below to create the data directory
sudo mkdir -p /data/db

4. Execute the command below to give the folder proper permission.
sudo chown -R $USER /data/db

5. Execute the command below in the same console window:
mongod

thanks to the following:
http://wesleytsai.io/2015/07/26/mongodb-server-directory-permission-denied/
https://docs.mongodb.com/manual/tutorial/install-mongodb-on-os-x/

Leave a Reply

Your email address will not be published. Required fields are marked *


*