How to connect to the Authenticated MongoDB database via MongoDB Compass?

From PheonixSolutions
Jump to navigation Jump to search

Introduction

[edit]

MongoDB Compass is a graphical user interface (GUI) tool designed to make working with MongoDB databases easier. One of its key features is the ability to connect to MongoDB databases, including those requiring authentication. Connecting to an authenticated MongoDB database via MongoDB Compass involves several steps, which we will outline below.

Prerequisites

[edit]

Before you begin, ensure you have the following:

1. MongoDB Compass installed on your system.

2. Access credentials for the MongoDB database you intend to connect to, including the hostname, port, username, and password.

Steps to Connect to an Authenticated MongoDB Database via MongoDB Compass

[edit]

Step 1: Open the MongoDB Compass application.

It will shows the page like below,

Step 2: Click on "Advanced Connection Options" and select the "Proxy/SSH" option.

Step 3: Choose the "SSH with Password" method and fill in the server login details.

Fill the server login details.

Step 4: Select the Authentication option and choose the "Username/Password" method. Provide the username, password, and for the Authentication Database name, use "admin".

Give the username, password and for Authentication Database name as admin.

Step 5: Click the "Connect" button at the bottom right of the page.

After a few seconds, MongoDB Compass should establish a connection to the database.

After few seconds it will connect to the database.

Conclusion

[edit]

Connecting to an authenticated MongoDB database via MongoDB Compass is a straightforward process that involves selecting the appropriate connection options, providing the necessary credentials, and initiating the connection. By following the outlined steps, you can easily leverage the graphical interface of MongoDB Compass to interact with your MongoDB databases securely and efficiently.