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
Method 1: Use the target event attribute of the E...
React native implements the monitoring gesture to...
Table of contents Preface 1. GMT What is GMT Hist...
Today, I encountered a little problem when I was ...
1. Compatibility As shown below: The compatibilit...
Preface: I have always wanted to know how a SQL s...
Table of contents Demand background Thought Analy...
I have written an article about mobile adaptation...
<br />Green is between yellow and blue (cold...
No gaps on both sides, gaps between each column w...
1. View the current host name [root@fangjian ~]# ...
Adding background image control to a component re...
Here we introduce the centos server with docker i...
MySQL password is correct but cannot log in local...
1. Command Introduction The ifconfig (configure a...