How to Installing MongoDB on macOS Catalina

How to Installing MongoDB on macOS Catalina

Installing MongoDB on macOS Catalina. The switch was mostly very smooth, with one main problem: setting up MongoDB. The problem is related to the latest major macOS release, Catalina, and in this article, I’ll share my solution.

Recently, I started a new developer job and switched from a Windows to a Mac. The switch was mostly very smooth, with one main problem: setting up MongoDB. The problem is related to the latest major macOS release, Catalina, and in this article, I’ll share my solution.

Setting up MongoDB to run on Catalina is more time-consuming than it should be, but hopefully, this article will save you from some of the headaches I went through!

The Problem

By default, MongoDB stores database information in the root folder, in data/db. But the Catalina update provides read-only access to the root. Based on this suggestion from Dom Berk, my solution was to move data/db to /System/Volumes/Data/data/db .

You could, in theory, place data/db wherever you like. But /System/Volumes/Data/ seems like a more secure option than somewhere like Documents.

1. Disable SIP

To access /System/, however, requires disabling macOS’s SIP (System Integrity Protection), which prevents modification to that directory. To disable SIP, you need to:

  • Boot into recovery mode by restarting and holding CMD + R during the boot-up.
  • Open up the terminal (which can be found under ‘Utilities’ in the top menu).
  • Inside the terminal, run csrutil disable. You can now reboot in normal mode.

2. Move Your /data/db Folder out of the Root

If you have data inside /data/db in the root, you can move it by providing temporary write-access to the root.

Once SIP is disabled, open the terminal and type sudo mount -uw /.

You can now move your folder out of the root and into /System/Volumes/Data/. This read-write ability will only last for the current session.

3. (Re)Install MongoDB

Next, I wanted to do a clean install of MongoDB. I tried a handful of different options, but Brew was the most convenient. For those who have tried to follow older tutorials, mongodb has been removed from homebrew-core.

Now, you’ll need to use mongo-community, which can be accessed as follows:

brew tap mongodb/brew
brew install mongodb-community
brew services start mongodb-community 

4. Run MongoDB From the Terminal

If everything’s worked correctly, you should now be able to run mongod and mongo — and see something other than a command not found error!

If we just run mongod, we’ll get errors that tell us the database directory is read-only. That’s because, by default, the command assumes that our database folder is in the root.

So, when running mongod, we need to specific --dbpath /System/Volumes/Data/data/db . Because we’re using /System/, we also need to use sudo. The full command is:

sudo mongod --dbpath /System/Volumes/Data/data/db
5. Create a Terminal Alias

That’s a bit tiresome to type every time. So, if you’re mostly using the same database path, I’d recommend setting up an alias.

If you use Zsh, you can add the following to ~/.zshrc:

alias mongod="sudo mongod --dbpath /System/Volumes/Data/data/db"

This means mongod will work pretty much as you’d expect. Just be aware that, if you ever need to change the --dbpath , you’ll need to disable this alias.

I hope that’s saved you some time and some frustration! Credit is due to Dom Berk, whose solution I’m building on in this article.

Guide to Python Programming Language

Guide to Python Programming Language

Guide to Python Programming Language

Description
The course will lead you from beginning level to advance in Python Programming Language. You do not need any prior knowledge on Python or any programming language or even programming to join the course and become an expert on the topic.

The course is begin continuously developing by adding lectures regularly.

Please see the Promo and free sample video to get to know more.

Hope you will enjoy it.

Basic knowledge
An Enthusiast Mind
A Computer
Basic Knowledge To Use Computer
Internet Connection
What will you learn
Will Be Expert On Python Programming Language
Build Application On Python Programming Language

Learn Python Programming

Learn Python Programming

Learn Python Programming

Description
Learn Python Programming

Learn Python Programming and increase your python programming skills with Coder Kovid.

Python is the highest growing programming language in this era. You can use Python to do everything like, web development, software development, cognitive development, machine learning, artificial intelligence, etc. You should learn python programming and increase your skills of programming.

In this course of learn python programming you don't need any prior programming knowledge. Every beginner can start with.

Basic knowledge
No prior knowledge needed to learn this course
What will you learn
Write Basic Syntax of Python Programming
Create Basic Real World Application
Program in a fluent manner
Get Familiar in Programming Environment

Python Programming & Data Handling

Python Programming & Data Handling

Python Programming & Data Handling

Description
Students will be able to know various commands include:

Python Basic Programming

string,if else,Range, for loop, while loop, making functions, tuple, dictionary etc

WEB WORKING:

Download files from Web, Exceptional Handling etc

Data Handling:

Get data from files create , read, write, delete.

IMAGE PROCESSING: (NEW DEVELOPING ART)

Image transformation , Image crop , edit and much more

Basic knowledge
Listener should know how about very basic C Language basic commands to understand Python Language
What will you learn
I will more update if any student want need to add more skills related to python