Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Simple configuration tutorial of MongoDb under Windows

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

This article gives you an answer on how to configure MongoDb simply under Windows.

Enter the installation directory with the administrator's startup cmd

Enter: mongod-- auth-- port 3406-- dbpath= library address-- logpath= full address-- install-- serviceName "custom name"

Note: the library address can only be specified to the folder, and the LOG address should be specified to a specific file.

-- auth enable right root control

-- port designated port

-- ip specifies that IP is local if it is not specified

-- serviceName windows service name

After the completion of the above

Enter the address and port connection library configured in the previous step:

Switch to admin

Create a Super Admin account:

Restart the service:

Log in 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"}]})

Built-in roles for MongoDB:

Database user roles: read, readWrite

Database management roles: dbAdmin, dbOwner, userAdmin

Group of administrators to manage the entire system: clusterAdmin, clusterManager, clusterMonitor, hostManager

Backup and restore role groups: backup, restore

All database roles: readAnyDatabase, readWriteAnyDatabase, userAdminAnyDatabase, dbAdminAnyDatabase

Super Admin: root, (the roles dbOwner, userAdmin, userAdminAnyDatabase provide any permission for any user of any data, and users with this role can define their own permissions on any database)

Internal role, generally speaking, it is not recommended to set: _ _ system

The above is the whole content of this article, I hope it will be helpful to your study, and I also hope that you will support it.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report