After mongodb enables authentication, the account can still perform database operations without entering a password.

after mongodb enables authentication, you only need to enter the user name and password for the first time, then disable the service and restart it, so that you do not need to enter the user name and password to perform database operations. How should it be solved?
Thank you ~

Mar.28,2021

the mongodb server also needs to add an auth parameter at startup, which is written as

in the document.
Run the database (mongod process) with the --auth option to enable security. You must either have added a user to the admin db before starting the server with --auth, or add the first user from the localhost interface.

I also think this design is very strange, why not just bring it by default.

Menu