Table of Contents

,

mongodb require password

In /etc/mongod.conf add:

security.authorization:
    enabled

then enter mongo:

mongo
use admin
db.createUser(
  {
    user: "root",
    pwd: "sql",
    roles: [ { role: "root", db: "admin" } ]
  }
)

Tested on

See also

References