start cmd with AdministratorEnter the installation directory input: Mongod--auth--port 3406--dbpath= Library address--logpath= full address--install--servicename "Custom Name"Note:The library address can be specified only to the folder, the log address must be specified to the specific file--auth enable power root control--port Specifying Ports--IP Specifies that the IP is not specified as local--serviceName Windows service nameafter completion of the aboveEnter the address and Port connection library for the previous step configuration: Switch to admin Create a Super Admin account: Restart Service: Login with the user you just created: Db.auth ("root002", "root002") Displaying 1 indicates that the login was successful. You can also create users for the specified library:Db.createuser ({User: "read",pwd: "read",roles:[{role: "read", DB: "Custom"}]}) MongoDB's built-in role:database User role: Read, ReadWritedatabase Management roles: DbAdmin, Dbowner, UseradminAdministrators group for the entire system management: Clusteradmin, Clustermanager, Clustermonitor, HostmanagerBackup Restore Role Group: backup, Restoreall database roles: Readanydatabase, Readwriteanydatabase, Useradminanydatabase, DbadminanydatabaseSuper admin: Root, (Dbowner, useradmin, useradminanydatabase These role roles provide any user's ability to any data, and users who have this role can define their own permissions on any database) internal role, generally not recommended setting: __system
Simple configuration of MongoDb under Windows