0
votes

I have a mongo db instance running in a linux box and i am trying to connect to it from my windows box. When I enable authentication, I keep getting

Invalid credential for database 'admin'..

my user setup looks like

show users { "_id" : "test.myuser", "user" : "myuser", "db" : "admin", "roles" : [ { "role" : "readWrite", "db" : "admin" }, { "role" : "userAdminAnyDatabase", "db" : "admin" } ] }

From the shell in my linux box if i do "mongo -u myuser -p password --authenticationDatabase admin" i am able to login. I am tring to use MongoVue and RoboMongo and both fails. I tried creating the same user in test database. The log says

2015-08-29T11:16:52.797-0400 I ACCESS [conn24] Failed to authenticate myuser@test with mechanism MONGODB-CR: AuthenticationFailed MONGODB-CR credentials missing in the user document

Looks like the client has not passed on the credentials. Any idea how to achieve this?

2
The Robomongo site (robomongo.org) states that it doesn't support MongoDB 3.0 yet. Not sure about MongoVue.James Wahlin

2 Answers

1
votes

I am not sure about the above solution should be fixed it. I hope this is will be resolved your error.Login into your server,

# mongo
> use admin
> db.system.users.remove({})    <== removing all users
> db.system.version.remove({}) <== removing current version 
> db.system.version.insert({ "_id" : "authSchema", "currentVersion" : 3 })
> exit

Restart your MongoDB

service mongod restart

Again, create a user name and password.

# mongo

> use admin
> db.createUser ( { user: "username", pwd: "password", roles: [ "readWrite", "dbAdmin", "dbOwner" ] } )
0
votes

I got it working with MongoChef. So it is a not supported issue for MongoVue and RoboMongo with the latest version of MongoDB server.