User Tools

Site Tools


wiki:mongodb_require_password

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

wiki/mongodb_require_password.txt · Last modified: 2022/10/15 11:39 by antisa

Except where otherwise noted, content on this wiki is licensed under the following license: CC0 1.0 Universal
CC0 1.0 Universal Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki