Install Mongodb On Mac Catalina

Open up a Terminal and type sudo mv after the prompt (username$). Click and drag the extracted mongodb folder into the Terminal. This will add the file path of the mongodb folder into the Terminal like so: C. Next hit space and type /usr/local/mongodb. The initial slash is super important, so make sure you type everything exactly, even. MongoDB expects the Data/data/db folders to be in a location which Mac OS Catalina does not allow. As a consequence the folders must be placed elsewhere, on one of the disk volumes. But modifying the MongoDB settings to find the new data folders is not working properly. There are many supposed solutions for this in various places on the web but none of them have solved my issues. If you have already done this for a previous installation of MongoDB, you can skip this step. To install MongoDB, run the following command in your macOS Terminal application: brew install mongodb-community@4.4. Created with Sketch. Alternatively, you can specify a previous version of MongoDB if desired. วิธีติดตั้ง MongoDB บน Mac (Catalina) คำแนะนำสั้น ๆ ในการติดตั้งและตั้งค่า MongoDB. I searched google to disable the default php of mac, before I install Homebrew. But could not find a good post. Can you please guide me with some resources on how to disable the default PHP. I am sorry for asking all these basic questions. I am windows user my whole life. Just switched to Mac before 1 month.

Install

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 On Mac Catalina Operating System

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:

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):

How To Install Mongodb On A Mac

Install

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 On Mac Catalina Os