June 2014
Intermediate to advanced
696 pages
38h 52m
English
You create a database administrator account by executing the addUser method in the MongoDB shell to access the admin database. Then you add a user with readWriteAny-Database, dbAdminAnyDatabase, and clusterAdmin rights. This gives that user the ability to access all databases in the system, create new databases, and manage MongoDB clusters and replicas. The following example creates a database administrator named dbadmin:
use admindb.addUser( { user: "dbadmin", pwd: "test", roles: [ "readWriteAnyDatabase", "dbAdminAnyDatabase", "clusterAdmin" ] } )
You can then use that user in the MongoDB shell to administer databases. Once you have created the new administrator account, ...
Read now
Unlock full access