all, I am new to mongoDB, and recently I am trying to set up a local env to try it, below is my step:
Use docker to create a mongoDB container:
docker run -d -name my-mongo -p 27017:27017 \ -e MONGO_INITDB_ROOT_USERNAME=admin \ -e MONGO_INITDB_ROOT_PASSWORD=Asdf1234 \ mongo:4
Then I use Studio 3T software to connect the admin database, and adds a new user named leon, below is the role I granted:
- Then I create another database with the user leon :
- Test the connection, the result is OK:
- Connect to the new database, and right click on the Manage users menu:
- But it always reports the non-authorized error:
Does anybody know the detail reason ?