MongoDB 3.x - Create Users

MongoDB 3 has a different way to create users compared to version 2.x. Now we need to use createUser rather than addUser.

Enter the console


Create a user on a database

use [database name]
     user: "[username]",
     pwd: "[plaintext password]",
     roles: [ ]

Read here to learn more about roles.




Stuart is a software developer with a passion for Linux and open source projects.

comments powered by Disqus
We are a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for us to earn fees by linking to and affiliated sites. More info.