We can use either hostname or database server IP for connecting to the database server.ĥ) Database name – This is defined as the name of the database which was used with the connection string to connect the database server. We need to specify the correct username password for connecting to the database server.Ĥ) Hostname – This is defined as the name of the user who was used to connect to the database server. We need to give specified privileges on the database to the user for performing the task.ģ) User password – This is defined as the user password which was used to authenticate a user with the database server. We can connect MongoDB compass by using the mongodb command, we can also pass the username, hostname, and password at the time of connecting to the database server.Ģ) Database username – This is defined as a username that was used to connect the database server. Mongo 'mongodb+srv://hostname/database_name' –database_username ġ) Mongodb – This parameter is used to connect the MongoDB database cluster using the MongoDB compass.
1) Connect to the database cluster using MongoDB compass Connect to the database cluster using MongoDB shell –