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 revision Previous revision
mongodb [2017/01/06 07:46]
felixonmars
mongodb [2017/01/06 07:47]
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.txt ยท Last modified: 2017/01/06 07:47 by felixonmars