A warning appears when connecting to MONGO: MongoDB access control is not enabled for the database
In fact, this is the problem of MONGO permissions, we have a lower privilege when connecting mongo.exe, this warning can be ignored. You can also use a new user name and password to resolve this issue:
1. Start the MongoDB service in the bin directory:
Mongod--port 27017--dbpath "C:\data\db"
2. Connecting Mongo.exe
MONGO--port 27017
3. Create a new user
Use admin
db.createuser (
{
User: "Mongouser",
pwd: "123",
roles: [{role: "Useradminanydatabase" , DB: "Admin"}]
}
)4. Restart the MongoDB service
Mongod--auth--port 27017--dbpath/data/db
5. Connect Mongo.exe with user name and password
MONGO--port 27017-u "Mongouser"-P "123"--authenticationdatabase "admin"
You can see that the MONGO has been connected successfully, and there is no warning.