So I'm trying to enable authentication for my MongoDB instance by setting security.authorization = enabled
in the configuration file. However, I am unable to find the mongod.conf
file or any equivalent configuration file for MongoDB Compass.
My MongoDB Compass installation directory structure looks like this:
app-1.43.0 (Folder)
packages (Folder)
app.ico
MongoDBCompass.exe
Squirrel-Shortcut.log
Squirrel-Unset.log
Update.exe
Could someone guide me on how to enable authentication for MongoDB when using MongoDB Compass? Where can I find the configuration file or how can I create one if it doesn't exist? Any help would be greatly appreciated.
Additional Info:
I have searched through the app-1.43.0
and packages
folders but couldn't find any configuration file related to MongoDB. And through the software "everything" but I can’t find this file nowhere…
There is nothing to configure in MongoDB Compass. When you enable authentication at database, then you must provide username/password (or x.509 certificate) at connection.
Typically you do this in connection string, i.e. your connection string changes from
mongodb://hostname:27017/myDB
for example to
mongodb://username:password@hostname:27017/myDB?authSource=admin