How to set username & password in MongoDB?

The easy way to set user name and password for a mongo db database:

use your_db_name
db.addUser(‘your_uesr_name’, ‘your_uesr_password’);
db.auth(‘your_uesr_name’, ‘your_uesr_password’);

That’s all…

If you need any more help please feel free to ask me. 🙂

2 Replies to “How to set username & password in MongoDB?”

  1. The easy way to set user name and password for a mongo db database:

    use your_db_name
    db.addUser(‘your_uesr_name’, ‘your_uesr_password’);
    db.auth(‘your_uesr_name’, ‘your_uesr_password’);

Leave a Reply to Opu Cancel reply

Your email address will not be published. Required fields are marked *