Easy spets to nstall MongoDB on Mac OS X ( I have used MAC OS – Mavericks)
Step 1: Download MongoDB:
Download MongoDB for MAC OS from official MongoDB site:
Step 2: Install MongoDB:
Step 3: Create MongoDB Data Directory:
By default, MongoDB write/store data into the
/data/db
folder, you need to create this folder manually and assign proper permission as given below:Step 4: Set you PATH on Bash Profile for MongoDB:
Uninstall Mongodb Mac
A guide to show you how to install MongoDB on Mac OS X. MongoDB 2.2.3 Mac OS X 10.8.2 1. Download MongoDB Get MongoDB from official website, extracts it: $ cd /Download $ tar xzf mongodb-osx-x8664-2.2.3.tgz $ sudo mv mongodb-osx-x8664-2.2.3 /usr/local/mongodb 2. MongoDB Data By default, MongoDB write/store data into the /data/db folder, you. I have Docker installed and am running a MongoDB container for my local development on my Mac. The problem is that I can't connect to said DB easily from CLI. I have Robo 3T installed, but I would prefer to use the CLI client instead. Is there a known way to install JUST the mongo shell (command mongo) and not the full DB distribution on OS X? How to Install MongoDB to Mac OS X with MacPorts. สวัสดีครับ ห่างหายกันมานานกับการเขียน blog ครั้งนี้เห็นทีว่าหากไม่เขียนบทความนี้เก็บไว้ คงได้ลืมกันเป็นแน่แท้ และหาก.
Create a
~/.bash_profile
file if not exists else update, and assign /usr/local/mongodb/bin
to $PATH environment variable, so that you can access MongoDB on commands easily.Step 5: Setting for auto start MongoDB:
To auto start yor installed mongoDB, create a launchd job on your Mac OS.
And add the following content to “/Library/LaunchDaemons/mongodb.plist”
Save the file and load the above job:
Now restart your MAC OS.
Step 6: Start MongoDB:
If you already have added the above steps then MongoDB will start by the time your MAC OS started.
Otherwise you have to start MongoDB by using the below command:
Now ready to use MongoDB,
1. Download latest source
2. Configuration
Enter the following
3. Add MongoDB to your Path
Add MongoDB
/bin
folder to your path.4. Permissions
We never want to run as super user but create a special daemon
_mongod
for this.Get the last used GID:
Therefore, here we will use 400 (make sure it is not taken).
![Download Download](/uploads/1/2/7/2/127243528/626672880.png)
Please note, on OS X, by convention, all daemon users are prefixed with an underscore, such as
_daemon
.Before creating a user, we create a group choosing an unused group id:Once done, we create a new user (we use the same id as we did for the group) - no shell is needed for daemon users:
Finally, permissions:
We can now open new terminal and test it works:
5. Create starting script
Install Mongodb On Mac
We can create a launchctl start script to start
mongod
automatically when starting OS X.Enter the following:
Load launchctl script
Match a Production environment
Debug
The following are useful debug commands if needed.