To create root user open the terminal then start the mongo shell
mongo
After its opened, run the following command:
use admin;
db.createUser( {
user: "root",
pwd: "root",
roles: [ "userAdminAnyDatabase",
"dbAdminAnyDatabase",
"readWriteAnyDatabase"
] } )
Change the root
in user
to whatever username you like and pwd
to set your password.