在Debian中配置MongoDB用户授权,您必须遵循以下步骤:如果尚未安装,请参阅官方的MongoDB文档,以获取在Debian上安装MongoDB的说明
并创建管理用户,您必须首先连接到MongoDB Shell。 使用以下命令将其连接到MongoDB:替换和使用所选用户名和密码。 成功创建管理员用户后,您将收到一条消息,表明已创建了用户。
数据库和用户
您可以创建一个新的数据库和用户并分配权限。 首先,切换到要创建用户的MongoDB Shell中的数据库。 意图t; Database_name>替换为选定的数据库名称。 用用户名,密码和您选择的角色替换,和。 例如,要通过阅读许可创建用户,请使用以下命令:
db.createuser({
用户:“ ”,
pwd:“ :“ :“ >:“ >:”
To log in as
and log in to mongodb with the newly created user, enter the following command in the Mongodb shell: Replace and with the selected username and password:
mongo -u -p -authenticationdatabase
Enter to run the命令。nul/referition/in-In-In-Inor/
上述内容来自Internet,并不代表本网站的所有视图! 关注我们:zhujipindao .com
评论前必须登录!
注册