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}}]