User Tools

Site Tools


mongodb

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
mongodb [2017/01/06 07:46] felixonmarsmongodb [2017/01/06 07:47] (current) felixonmars
Line 1: Line 1:
-==== Authentication (For MongoDB >= 2.4) ====+==== Authentication ====
 === Add A User Administrator as Per Recommended by MongoDB === === Add A User Administrator as Per Recommended by MongoDB ===
 <code> <code>
Line 7: Line 7:
 </code> </code>
  
-=== Add A FULL PRIVILEGED User (For Unlocking Full Functionality of RockMongo, etc) ===+=== Add A FULL PRIVILEGED User (to unlock full functionality of RockMongo, etc) ===
 <code> <code>
 $ mongo $ mongo
 > db = db.getSiblingDB('admin') > db = db.getSiblingDB('admin')
 > db.createUser({user: "username", pwd: "password", roles: ["dbAdminAnyDatabase", "userAdminAnyDatabase", "readWriteAnyDatabase", "clusterAdmin"]}) > db.createUser({user: "username", pwd: "password", roles: ["dbAdminAnyDatabase", "userAdminAnyDatabase", "readWriteAnyDatabase", "clusterAdmin"]})
-</code> 
- 
-==== Authentication (For MongoDB < 2.4) ==== 
-<code> 
-$ mongo 
-> use admin 
-> db.addUser("username", "password") 
 </code> </code>
  
mongodb.1483688805.txt.gz · Last modified: 2017/01/06 07:46 by felixonmars