2

I'm working on MongoDB, sysadmin helped setup the install.

I'm confused about MMS the Cloud Manager, I created an account for @admin database

enter image description here

I authenticate successfully but do not see "test" database LinuxBox> ./mongo myipaddress:27000/admin -u DBASupport -p ** if I don't use /admin I default to "test" db

show dbs; admin 0.078GB local 0.078GB show collections; system.indexes system.users system.version

I am assuming I'm using a GLOBAL DB Admin account I created.. but it looks like it's for the "Admin" database.

Alternatively when I created another account "Test" as the database login "MyTestLogin" with Admin role... the Database I default connect to is "Test" database?

I thought since I'm connecting to same port 27000 with same MongoDB instance/service... I would see admin, local, and test databases??

I know i'm missing something here, but can some one explain

thanks

2 Answers 2

2

You created the user correctly, but you missed a parameter when connecting to mongod.

By default, the authentication process assumes that the user is stored in the database you connect to, which in your case simply isn't true.

You need to specify the autheticationDatabase option:

mongo yourMongodIpAddress:27000/targetDb \
--authenticationDatabase admin -u DBASupport -p yourPw
0
0

Please have a look at the Built-in Roles documentation of Mongo.

  1. There are different admin roles that can indeed only do some administration. But you can add multiple roles to your user. So adding the 'readWriteAnyDatabase' would give that admin 'user'-rights to use any other database also.

  2. 'test'-database is indeed the default database where you enter when you don't specify a database. Then you can always jump to other databases with 'use myDbName'. But probably when you specify the user roles correctly, that will be clear then.

Documentation: http://docs.mongodb.org/manual/reference/built-in-roles/

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.