After the container is started Log in to admin first and create a new user $ docker exec -it mongo mongo admin # Create a user named admin with a password of 123456. >db.createUser({user:"duser",pwd:"test1mongodb23","roles" : [{"role" : "dbAdmin","db" : "cpeducloud2"}, {"role" : "dbOwner","db" : "cpeducloud2"},{"role" : "readWrite","db" : "cpeducloud2"}, {"role" : "userAdmin","db" : "cpeducloud2"}],"mechanisms" : ["SCRAM-SHA-1","SCRAM-SHA-256"]}); # Try to connect using the user information created above. > db.auth('duser', 'test1mongodb23') The creation is successful here, so create a new library and account here (note that this is the case of admin login) For example, the library created here is sboot, After creating the user, log out and log in again with the new user in the new database (sboot) The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
>>: MySQL bypasses granting information_schema objects and reports ERROR 1044 (4200) error
Trigger Introduction A trigger is a special store...
Preface All requests in Tomcat are handled by Ser...
This tag is not part of HTML3.2 and is only suppo...
Those who have played King of Glory should be fam...
Installing Electron cnpm install electron -g Inst...
The solution is as follows: 1. Force delete conta...
1. Install ffmpeg under centos linux 1. Download ...
brew install nginx Apple Mac uses brew to install...
https base port 443. It is used for something cal...
I often need to change nginx configuration at wor...
As a front-end Web engineer, you must have encoun...
Nginx is developed in C language and is recommend...
Table of contents 1. Installation 2. There is no ...
Table of contents Solution: 1. IGNORE 2. REPLACE ...
This article uses examples to illustrate the usag...