简体   繁体   中英

MongoDB collections in zero with authentication

We currently are trying to make MongoDB 3.0 a bit more secure by adding users, roles and passwords, disabling the anonymous logins

However, when we enable auth=true or the --auth command in starting MongoDB, we can login with the DB administrator, (admins all of the DB) but we can't see any data in MongoDB Compass when the authentication is turned on, also, it shows that all of the databases have 0 Bytes of size and no Collection is shown.

Can you help me pinpoint where is the issue?

EDIT: Here is an Image of the things that our DB show on the Compass Community Edition, per clarification of the question 图片来自Mongo社区

I solved this issue by adding the Read Role to the user Database by Database, also, in the login, I have to explicitly state the Database I am going to connect to

Basically the dbAdmin does not have the read role and has to be included manually

Regards and thanks

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM