-
Notifications
You must be signed in to change notification settings - Fork 16
Install MongoDB Community Server (MacOS)
Ben Elferink edited this page Feb 20, 2022
·
6 revisions
MongoDB is a noSQL database.
source: https://www.mongodb.com
- open terminal
sudo rm -rf /Library/Developer/CommandLineTools
sudo xcode-select --install

- open terminal
brew tap mongodb/brew
brew install mongodb-community
- open terminal
mongo —version

- open terminal
-
brew services start mongodb-community
starts service -
mongo
opens shell - type
help
for more

- open mongo shell (terminal)
-
CTRL + C
terminates shell -
brew services stop mongodb-community
stops service
(where [username] is your computer user, whoami
will show you that name)
- open terminal
-
sudo chown [username] /usr/local/var/mongodb
allows read & write access -
sudo chown <username> /usr/local/var/log/mongodb
allows read & write access -
mongod —config /usr/local/etc/mongod.conf
starts the service manually

- open new terminal
-
mongo
opens shell - type
help
for more

- open mongo shell (terminal)
-
CTRL + C
terminates shell - at the mongod service terminal do
CTRL + C
Forgot to do step 3, and terminal is closed, no worries:
- open terminal
-
sudo pkill -f mongod
will ask for password