シェルはユーザー名とパスワードを使用してMongoDBにログインします

1.MongoDBクライアントを起動します

/usr/local/mongdb/bin/mongo

2. adminに切り替えて、ユーザー名とパスワードを入力します

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

1が返された場合、ログインは成功しています。

おすすめ

転載: blog.csdn.net/weixin_38664232/article/details/109311245