Install Mongodb Mac Catalina

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

  1. Install Mongodb Macos Catalina
  2. Install Mongodb Mac Catalina Os
  3. Install Mongodb Mac Catalina
  4. Install Mongodb Mac Catalina Free

问题I have installed mongodb on my mac Catalina 10.15. I have php7.3 version installed as well. Now, I want to use the mongoClient class with PHP. I tried composer require mongodb/mongodb but it says.

  • Today, you'll learn to install the MongoDB community edition on macOS Catalina and higher. Creating Data Folder. Before you install and use MongoDB, you need to create a data/db folder on your computer for storing MongoDB data. Before macOS Catalina, you can create this folder in the user's root directory with the following command.
  • How to install MongoDB on Mac OS Catalina (locally) If you are like me, running mongo servers on cloud IDE’s is just not the same as the customizations I have in my visual studio code. The need to test MongoDB servers locally sounds like an ideal option but I was running into issues trying to get the darn thing installed.

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

Install Mongodb Macos Catalina

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

Install Mongodb Mac Catalina

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.

Install Mongodb Mac Catalina

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

This is where you will be typing your commands.

I recently bought a new iMac and moved all of my files over using Time Machine. The migration went really well overall and within a few hours I had my development machine up and running. After starting an application I’m building I quickly realized that I couldn’t get MongoDB to start. Running the following command resulted in an error about the data/db directory being read-only:

I tried every chmod and chown command known to man and woman kind, tried manually changing security in Finder, compared security to my other iMac (they were the same), and tried a bunch of other things as well. But, try as I might I still saw the read-only folder error when trying to start the server….very frustrating. I found a lot of posts with the same issue but they all solved it by changing security on the folder. That wasn’t the problem on my machine.

After doing more research I found out that Catalina added a new volume to the hard drive and creates a special folder where the MongoDB files need to go. The new folder is:

The MongoDB files can then go at:

I ran the following commands to install the latest version of MongoDB using Homebrew (see https://github.com/mongodb/homebrew-brew for more details):

Install Mongodb Mac Catalina Os

I then went into the MongoDB config file at /usr/local/etc/mongod.conf. Note that it’s possible yours may be located in a different location based on how you installed MongoDB. I changed the dbPath value to the following and copied my existing DB files into the folder:

Install Mongodb Mac Catalina

Finally, I made sure my account had the proper access to the folder by running chown (something I had tried many times earlier but on a folder outside of /System/Volumes/Data):

After that I was able to start MongoDB and everything was back to normal. Hopefully this saves someone a few hours – I wasted way too much time on the issue. 🙂


Install Mongodb Mac Catalina Free