Install Mongodb Catalina

I recently upgrade my Mac OS Sierra to Catalina and realize that the mongoDB was not usable in Catalina, somehow `brew update` and `brew upgrade` did not update the mongoDB to be able to run on Catalina. Below is a guide to fix it. The problem is related to the latest major macOS release, Catalina, and in this article, I’ll share my solution. Install MongoDb Community version by executing the following commands on your terminal. Brew tap mongodb/brew brew install mongodb-community@ 4. This ensures mongodb is installed successfully on your machine. The following are some useful commands to run mongo on your machine. To run MongoDB as a macOS service brew services start mongodb.

In this tutorial, we present a step by step tutorial on how to install MongoDB on Mac OS.

The operating system considered for this tutorial is macOS 10.14 (Mojave).

1. Download the Community Edition of MongoDB from here: https://www.mongodb.com/download-center/community. It will be a TGZ file, something like mongodb-osx-ssl-x86_64-4.0.11.tgz

2. After completion of download, navigate to the /Downloads directory.

3. Extract the downloaded .tar file.

4. Now move the extracted directory to /usr/local/mongo

5. Navigate to /usr/local/mongo

6. Now MongoDB needs a data directory to store data. By default, it stores at /data/db but you need to create it.

Mac

7. With the data directory created, you need to set the correct permissions. You first check and get your current username and set permissions to it.

9. Get back to the root directory.

10. List all files, including those starting with .

11. If you already find the .bash_profile file listed, open it. If not, create and open it.

12. Copy the following two lines of code and append at the end of the file.

13. Save the changes, press CTRL + S.

14. Restart the terminal, or read and execute the .bash_profile file again

15. If the installation is successful, the following command will give the version of MongoDB just installed on your system.

16. Now we get to work with MongoDB. The first is to run the Mongo Daemon mongod

17. Next, open a new terminal window and start the Mongo shell

Install Mongodb Catalina Free

This is where you will be typing your commands.

Question or issue on macOS:

I’m relatively new to MongoDB and am trying to install MongoDB on my Mac with Homebrew, but I’m getting the following error:

I ran
brew update
Then
brew install mongodb

How to solve this problem?

Solution no. 1:

Formula mongodb has been removed from homebrew-core. Check pr-43770 from homebrew-core


To our users: if you came here because mongodb stopped working for you, we have removed it from the Homebrew core formulas since it was migrated to a non open-source license.

Fortunately, the team of mongodb is maintaining a custom Homebrew tap. You can uninstall the old mongodb and reinstall the new one from the new tap.

Check mongodb/homebrew-brew for more info.

Solution no. 2:

first install mongoldb

Secondly install using this command. mangodb successfully installed

You will get the output

Solution no. 3:

Try this code in your terminal:

And then:

Finally:

Solution no. 4:

In MacOs Catalina doesn’t work properly for me.

After the installation (https://zellwk.com/blog/install-mongodb/) i had to add permission to “/tmp/mongodb-27017.sock”

and the command “mongod” seems to ignore the config file (mongod.conf) in “/usr/local/etc” so i have to always launch it with the dbpath argument

even if the same path is specified in the config file.

Also using “mongod” with configuration file doesn’t work for me

Install Mongodb Mac Catalina

or

I solved all these issues starting the mongodb via brew services. That worked well without issues and takes the parameters from the right configuration file.

Install Mongodb Catalina Mac

Hope this helps!