Changing dbPath doesn't work

Hello! I have been using mac’s terminal instead of web terminal on the MDBU page. I was not able to start the db server due to file systems permissions. Apparently from Catalina onwards some of the directories have been made read only. To bypass that I went ahead and made changes to the usr/local/etc/mongod.conf and edited the dbPath. And yet, it gives me the “error”:"NonExistentPath: Data directory /data/db not found. Long story short, I have to supply the dbpath manually every time I restart the server. Am I supposed to make changes to some other .conf?

Hi @Praveen_77673,

Welcome to the MongoDB Community Forums,

First of all, we highly recommend you use the inbuilt IDE to complete the lab within the course.
Secondly, you can find the solution to your problem here

Hope it helps!!

In case of any further questions, please feel free to reach out.

Thanks,
Kushagra

Thanks @Kushagra_Kesav! I came from M001 and had mongosh running on the system already so I thought I’d keep using the terminal instead of the inbuilt IDE. I did some research before posting here and figured root access has been removed in the newer macOS version. All that being said, I had already created the data/db in my home directory so that should take care of the write permission and had also made changes to mongod.conf with the complete path. But the problem still persists.

Here’s screenshot:
Screenshot 2021-08-08 at 12.59.49 PM

What command you used to start mongod?
That could explain why you are getting dbpath error

1 Like

I used mongod in the terminal! as suggested in the very first video lecture of M102

Post the screenshot of what you did.

We are not too sure about what has to be done for

We know about M103 but not M102. A typing error happens so fast. We are also not sure which one is the good one:

/User/praveen.sharma
or
/Users/pravee.sharma.

Hey Steeve! I definitely meant to say M103 :smiley: Thank you for pointing out that typo in the configuration file. Let me fix that and get back to you

Here you go:

When you try to bring up mongod by running just the mongod command it will not work on Mac OS
Reason you have already mentioned (access to root folder removed)
Though you have edited config file it is not using this file
Either you bring it up by running the service or mongod --config your_config_file

3 Likes

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.