This tutorial explains how to install mongodb on MacOS
Mongodb Provides two types of packages (msi and zip) to download and install on Windows.
There are multiple ways we can install any software on MacOS.
- using homebrew
Install MongoDB on MacOS using Homebrew
Following are steps by steps to download and install on macOS First, install xcode-select tools.
xcode-select --install
Next, install using homebrew
brew tap mongodb/brew
Next, Update the brew tool to update dependencies
brew update
How to start/stop/restart mongoservice
run the below command to start Mongodb,
brew services start [email protected]
run the below command to stop Mongodb,
brew services stop [email protected]
run below command to restart mongodb,
brew services restart [email protected]
Mongodb Location on MacOS
MongoDB installation creates files in the MAcOS file system based on processor type.
file types | Silicon Processor | Intel processor |
---|---|---|
Mongo configuration | /opt/homebrew/etc/mongod.conf | /usr/local/etc/mongod.conf |
log directory | /opt/homebrew/var/log/mongodb | /usr/local/var/log/mongodb |
Data Directory | /opt/homebrew/var/mongodb | /usr/local/var/mongodb |