2

I am using Ubuntu16.04 and i had enabled authorization in mongodb and created user via following.

use admin
db.createUser(
  {
    user: "ABC",
    pwd: "XYZ",
    roles: [ { role: "root", db: "admin" } ]
  }
);

And after restarting mongodb server authorization working fine while connecting to the mongodb via terminal.

sudo service mongod restart
mongo -u ABC -p --authenticationDatabase admin

But when i am trying to connect to my localhost mongodb database with Studio3T with following

Authentication Mode : "Basic (MONGODB-CR or SCRAM-SHA-1)"
username : (ABC)
password : (XYX)
Authentication DB: (admin)   

I am getting error message as following.

Connection failed.

SERVER [localhost:27017] (Type: UNKNOWN) 
|_/ Connection error (MongoSocketWriteException): Exception sending message
|____/ Socket error: Connection reset

Details:
Timed out after 30000 ms while waiting to connect. Client view of cluster state is {type=UNKNOWN, servers=[{address=localhost:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketWriteException: Exception sending message}, caused by {java.net.SocketException: Connection reset}}]
Stephen Kennedy
  • 20,585
  • 22
  • 95
  • 108
Jitendra
  • 3,135
  • 2
  • 26
  • 42
  • i also face the same issue on current release: Connection failed. SERVER [localhost:27017] (Type: UNKNOWN) |_/ Connection error (MongoSocketWriteException): Exception sending message |____/ SSL error: Remote host closed connection during handshake |_______/ I/O error: SSL peer shut down incorrectly – mtamma Jun 05 '18 at 04:17
  • any solution to this? – Habib Rehman Dec 09 '20 at 16:50

0 Answers0