citmusa
5/19/2017 - 3:56 PM

mongodb in mac with homebrew

mongodb in mac with homebrew

# install mongo
brew install mongodb

#create the path in which mongo will store databases (it is recommended not to change this path)
sudo mkdir -p /data/db

#give us permissions over data/db:
# get our name
whoami
# get ownership:
sudo chown -R {USERNAME} /data/db  # replacing {USERNAME}

# Test everithing went ok
mongod 
# the output must end in something like
# NETWORK  [thread1] waiting for connections on port 27017