![]() As the name specifies SSL it is used whether our database connection string will establish the SSL or not. SSL is also the connection string option which was we have used in it. This option basically specifies the replica set of our master database using one of them. We can also use the replica set option with our connection string in MongoDB. We need the correct username and password to connect to the MongoDB database server. # mongosh "mongodb+srv:///myFirstDatabase" -username dbuser Also we have used hostname as “” and used command as “mongosh” to connect the database server. In the below example we have used username as “dbuser” and used incorrect password so it will give an error, we will not connect to the database server. The below example shows that we need the correct username and password to connect the MongoDB database server. If suppose username or password is incorrect it will issue the error as authentication failed. If the username and password authentication are successful it will give access to the specified database. It will contain the below string parameters while connecting to the database server.Īt the time of connecting to the MongoDB database server first, it will check our username and password. How does Connection String work in MongoDB? This is an optional parameter while using connection string in MongoDB.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |