Database
...
MongoDB
Examples of authorization sett...
Setting up authorization in Linux
8min
connect and create a user in mongodb connecting to shell connect to the mongodb shell mongo(sh) creating a user switch to the admin database use admin create a user by changing the login (user) and password (pwd) of the user db createuser({ user "adminuser", pwd "password", roles \[ { role "root", db "admin" } ], passworddigestor "server" }) in mongodb, you cannot use the characters , @ , $ , , % , " , ' , / , \ , | in usernames and passwords, as this can cause issues with connection of the application server to mongodb enable authorisation and connect passwork enabling authorization in mongodb you need to edit the mongodb config file to enable authorisation, run the following commands in the shell to get the location var cmdlineopts = db servercmdlineopts(); print("config " + cmdlineopts parsed config); edit the resulting configuration file by adding a line security authorization enabled save the changes and restart the mongodb service systemctl restart mongod service to test, connect to the shell with authorisation mongo(sh) "mongodb //adminuser\ password\@localhost 27017" setting up and connecting passwork with authorization you need to edit the passwork configuration file at /var/www/init/config env and specify the login and password of the created user mongodb username=adminuser mongodb password=password save the changes and refresh the passwork page to test the connection with mongodb authorisation