Changing the password in MongoDB for existing user

Srivatsa N picture Srivatsa N · Apr 30, 2013 · Viewed 30.8k times · Source

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.

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

Answer

Gabriel picture Gabriel · May 17, 2013