MongoDB中更改密码为现有用户 [英] Changing the password in MongoDB for existing user

查看:204
本文介绍了MongoDB中更改密码为现有用户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的生产环境中,我的MongoDB是启动和运行人员和数据库管理员要求我们改变我们使用认证的密码。这样做的一种方法是在更改密码再次说明使用新密码运行adduser命令

I have production environment where my mongoDB is up and running and DBAs are asking us to change the password which we use for authentication. One way to do this is run the addUser command again with a new password as described in change password

> db.auth("app_user", "somepassword")
db.addUser("app_user", "new password")

这是一样好添加新用户。

This is as good as a adding a new user.

我明白,我有一次,我添加描述一个新用户的,但因为这是一个生产包膜,我不能重新启动我的服务器。是否有任何其他的选择吗?或者,如果我的做法是错误的如何在MongoDB中更改密码

I understand that I have to restart mongod with the --auth option once I add a new user as described in but as this is a production env and I can't restart my server. Is there any other option ? or if my approach is wrong how to change the password in mongoDB

推荐答案

有关V2.4

db.changeUserPassword("app_user", "new password")

https://groups.google.com/d/ MSG / MongoDB的用户/ KkXbDCsCfOs / rk2_h-oSbAwJ
https://jira.mongodb.org/browse/DOCS-1515

这篇关于MongoDB中更改密码为现有用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆