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.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3f0c8-2b7c6.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3f0c8-2b7c6.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?