MongoDB server not starting up on local machine

Viewed 23

I have been trying to start the mongodb server on my local machine but it is NOT working. It used to work earlier without any errors. I am using macOS Big Sur.

I typed the following in my terminal. I have my mongodb database files setup in mongodb-data folder.

sudo mongod --dbpath “/Users/userName/mongodb-data”

but this is giving error and exiting with an exit code of 100. I have made sure mongodb-data folder is present.

Here is a snippet from the error log:

"ctx":"initandlisten","msg":"DBException in initAndListen, terminating","attr":{"error":"NonExistentPath: Data directory “/Users/userName/mongodb-data” not found. Create the missing directory or specify another path using (1) the --dbpath command line option, or (2) by adding the 'storage.dbPath' option in the configuration file."}}

The only change I have made is to replace my name by userName for privacy.

Any suggestions?

0 Answers
Related