Installing MongoDB on a Mac with Homebrew

CK1820 
Created at May 09, 2018 05:21:06
Updated at Dec 17, 2023 06:43:58 
340   0   0   0  

Installing MongoDB on Mac OS X
 

1. Open the Terminal app and type

% brew update

 

2. After updating Homebrew

% brew install mongodb

 

After downloading Mongo, create the “db” directory. This is where the Mongo data files will live. You can create the directory in the default location by running

% sudo mkdir -p /data/db
% sudo chown [user_name] /data/db

Run the Mongo daemon, in one of your terminal windows run

% mongod

 

This should start the Mongo server.

Run the Mongo shell, with the Mongo daemon running in one terminal, type below in another terminal window.

mongo
  1. This will run the Mongo shell which is an application to access data in MongoDB.
  2. To exit the Mongo shell run quit()
  3. To stop the Mongo daemon hit ctrl-c


Installing MongoDB Driver running on PHP

  • Before installing MongoDB driver, you should check your PHP version first. Actually there are various version of PHP version. In my case, php version is 7.1.7
%php -ver
PHP 7.1.7 (cli) (built: Jul 15 2017 18:08:09) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies

 



Tags: Homebrew Mac Mac OS X MongoDB Share on Facebook Share on X

▶ NEXT
How do I input switch Korean to Chinese on Mac?
  Comments 0
Login for comment
SIMILAR POSTS

How do I input switch Korean to Chinese on Mac? (created at Dec 21, 2019)


OTHER POSTS IN THE SAME CATEGORY

How do I input switch Korean to Chinese on Mac? (created at Dec 21, 2019)

UPDATES

Creating a Pinterest-Style Card Layout with Bootstrap and Masonry (created at Apr 24, 2024)

Mastering Excel Data Importation in PHP (updated at Apr 24, 2024)

JSON format control in PHP (updated at Apr 24, 2024)

Equal Height Blocks in Bootstrap with JavaScript (created at Apr 22, 2024)

How to convert integer to text string ? (updated at Apr 22, 2024)

Checking similarity between two strings in PHP (updated at Apr 21, 2024)

Create Blob Image in HTML based on the given Text, Width and Height in the Center of the Image without saving file (updated at Apr 21, 2024)

How do I determine the client IP type (IPv4/IPv6) in PHP (updated at Apr 16, 2024)

How do I determine the client IP type in Python - IPv4 or IPv6 (updated at Apr 13, 2024)

Getting Started with PyTorch: A Beginner's Guide to Building Your First Neural Network (updated at Apr 09, 2024)

Predicting Buyer Preferences with PyTorch: A Deep Learning Approach (updated at Apr 09, 2024)

Forecasting the Weather with PyTorch: A Beginner's Guide to Temperature Prediction (created at Apr 09, 2024)

PyTorch example to Forcast Stock Price based on 10 days Dataset (created at Apr 09, 2024)

Mastering Model Persistence: Saving and Loading Trained Machine Learning Models in Python (created at Apr 08, 2024)

Harnessing the Power of Random Forest Algorithm in Python (created at Apr 08, 2024)

Understanding and Implementing K-Nearest Neighbors (KNN) Algorithm in Python (created at Apr 08, 2024)

Forecasting with Linear Regression and KNN Regression in Python (updated at Apr 07, 2024)

What is 302 Found Redirection in HTTP 1.1? (created at Apr 04, 2024)

Mastering Random Forest Regression: A Comprehensive Guide with Python Examples (updated at Apr 01, 2024)

Python Implementation of Linear Regression (updated at Apr 01, 2024)

Mastering Supervised Machine Learning with Python: A Comprehensive Guide (created at Apr 01, 2024)

Mastering AI: A Beginner's Guide to Python Programming and Beyond (created at Apr 01, 2024)

How do I create animated background for Google Meet? (updated at Mar 28, 2024)

Building a Simple DNS Server in Delphi with TTL Support (created at Mar 16, 2024)

How to force cookies, disable php sessid in URL ? (updated at Mar 16, 2024)

Implementing a Versatile DNS Server in PHP: Handling A, AAAA, CNAME, and TXT Records (updated at Mar 16, 2024)

Implementing a Versatile DNS Server in Python: Handling A, AAAA, CNAME, and TXT Records (created at Mar 16, 2024)

Building a Basic DNS Server in PHP/Python: A Beginner's Guide (updated at Mar 15, 2024)

Dynamic DNS Made Easy: Building a Python-Based Solution (created at Mar 15, 2024)

Exploring the Depths of Data Transfer: sendfile vs. kTLS (created at Mar 15, 2024)