"The development process of the essay summary, you are welcome to review, you can do more rigorous "
Introduction:MongoDB NoSQL Database Document type database
A few days ago, to do a log collation of the project when the persistent storage with MongoDB to prevent MongoDB without permission to link, added permission verification
1 if MongoDB is an open intranet address, don't worry about external links
2 MongoDB Add Users (version MongoDB 3.2.7)
- Licensing method to start a service
To allow the user to take effect , specify the--auth option when the server needs to be started .
- Authorization before manipulating MongoDB
Db.auth (' root ', ' password ')
1 MONGO Create a database is an implicitly created use Usertest (delete db.dropdatabase ()) 2 db.createcollection (' TestTable '). Collection can also be created implicitly (Db.testTable.drop ())
Useradmin, Roles is clusteradmin and readanydatabase and read and write ReadWrite
Db.createuser ({"User": "Useradmin",
"pwd": "Password",
"Roles": [{role: ' Clusteradmin ', db: ' admin '},
{role: "Readanydatabase", DB: "Admin"},
"ReadWrite"
] },
{w: "Majority", wtimeout:5000})
Delete User Db.dropuser (' natureadmin ')
Db.auth (' useradmin ', ' password ')
End
Mongodb authorized users to manage Add users