The shell logs in to MongoDB with a username and password

1. Start the MongoDB client

/usr/local/mongdb/bin/mongo

2. Switch to admin, and enter the user name and password

> use admin
> db.auth("username","password")

If it returns 1, the login is successful.

Guess you like

Origin blog.csdn.net/weixin_38664232/article/details/109311245