In your new MongoDB 3.0.7 version, with remote database connection and authentication enabled in your system. If you are trying to remote connection with third party tool to his MongoDB database. Connection accepted from the remote database but the authentication failed.
You need to check in the MongoDB log /var/log/mongodb/mongod.log
# tail -f /var/log/mongodb/mongod.log
...
2015-10-16T05:04:13.800-0500 I NETWORK [initandlisten] connection accepted from 192.168.1.1:56490 #58192 (1 connection now open)
2015-10-16T05:04:14.086-0500 I ACCESS [conn58192] authenticate db: admin { authenticate: 1, nonce: "xxx", user: "thelinuxfaq", key: "xxx" }
2015-10-16T05:04:14.087-0500 I ACCESS [conn58192] Failed to authenticate thelinuxfaq@admin with mechanism MONGODB-CR: AuthenticationFailed MONGODB-CR credentials missing in the user document
...
Just refer the MongoDB 3.X authentication mechanism:
root@thelinuxfaq:~# mongo
MongoDB shell version: 3.0.7
connecting to: test
> user admin
You need to execute (on admin user) the below commands,
> var schema = db.system.version.findOne({"_id" : "authSchema"})
> schema.currentVersion = 3
> db.system.version.save(schema)
Check your user authentication mechanism:
> db.system.users.find()
{ "_id" : "admin.linuxfaq", "user" : "linuxfaq", "db" : "admin", "credentials" : { "MONGODB-CR" : "a08d3b476fe665c3c098bab748800ca8" }, "roles" : [ { "role" : "readWrite", "db" : "admin" }, { "role" : "dbAdmin", "db" : "admin" } ] }
> exit.
Now, check your remote connectivity in your third party tool.
Still you may getting an error just remove that specific user and create it again.
Comments (0)