ahwyX100
ahwyX100

Reputation: 605

MongoDB: Why always report non-authorized error when try to manage users in one database?

all, I am new to mongoDB, and recently I am trying to set up a local env to try it, below is my step:

  1. 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
    
  2. Then I use Studio 3T software to connect the admin database, and adds a new user named leon, below is the role I granted:

admin database users

  1. Then I create another database with the user leon :

create a new data base

  1. Test the connection, the result is OK:

Test connection of new database

  1. Connect to the new database, and right click on the Manage users menu:

right click manage users menu

  1. But it always reports the non-authorized error:

non authorized error

Does anybody know the detail reason ?

Upvotes: 0

Views: 177

Answers (0)

Related Questions