Mongodb – Getting error while creating a New Connection using Studio 3T for Mongo DB

mongodbmongodb-4.0windows

I tried to create a new connection with Studio 3T for Mongo DB. I don't have a previous DB connection and this is the new one that I am trying to create it. I can't able to figure out why this is happening.

When tried to do so, I got an error stating:

Error Details :

Database error (MongoSecurityException): Exception authenticating
MongoCredential{mechanism=SCRAM-SHA-256,
userName='{{my_db_username}}', source='admin', password=,
mechanismProperties={}}.

This is StackTrace:

Stacktrace: |_/ Database error (MongoSecurityException): Exception
authenticating MongoCredential{mechanism=SCRAM-SHA-256,
userName='sociofyDB_rifaye', source='admin', password=,
mechanismProperties={}} |____/ Mongo Server error
(MongoCommandException): Command failed with error 18
(AuthenticationFailed): 'Authentication failed.' on server
localhost:27017. |____… |____… The full response is: |____… {

|____… "ok" : 0.0,
|____… "errmsg" : "Authentication failed.",
|____… "code" : NumberInt(18),
|____… "codeName" : "AuthenticationFailed"
|____… }

enter image description here

EDIT: I see this error majorly when I try to provide the authentications. This does not occur when I connect normally without the authentication(username/pwd).

Best Answer

As per MongoDB articles blog here The Connection Manager in Studio 3T makes it easy to connect to MongoDB, whether it is cloud-hosted or on-premise, or through a direct connection or a replica set.

Create a new connection

  1. Open Studio 3T.
  2. Click on the Connect button either in the global toolbar or under the Recent Connections tab. This will open the Connection Manager.
  3. Click on New Connection. This will open the New Connection window.

Please note that with the release of Studio 3T 2018.6 and support for SCRAM-SHA-256, it will no longer be possible to connect to MongoDB version 2.6, which reached its end of life in October 2016. Only MongoDB versions 3.0 and higher are supported.

Studio 3T supports various settings nested under the Server, Authentication, SSL, SSH Tunnel, and Advanced tabs:

Server

  • Direct Connection
  • Replica Set or Sharded Cluster

Authentication

  • Basic (SCRAM-SHA-256)
  • Legacy (MongoDB-CR or SCRAM-SHA-1)
  • X.509
  • Kerberos (GSSAPI) - Enterprise only
  • LDAP (PLAIN) - Enterprise only

SSL

  • Accept any server SSL certificate
  • Use own Root CA file
  • Accept trusted server SSL certificates
  • Use Client Certificate
  • Allow invalid hostnames
  • User Server Name Indication

SSH Tunnel - Use SSH tunnel to connect

Advanced

  • Max. connection idle time
  • Server selection timeout
  • Socket timeout
  • Connect timeout

As I am able to see from attached screen shot as Studio 3T is showing the TRIAL License. Instead of Studio 3T IDE you can use the Robo 3T (formerly Robomongo) is the free lightweight GUI for MongoDB.

For example the simple new connection of Robo 3T (Robomongo) will be as follows:

enter image description here

For further your ref here , here and here