mongodb logical sessions can’t have multiple authenticated users(mongodb logical sessions can’t have multiple authenticated users)

前言

使用 mongodb db.auth,切换用户时,报以下错误

logical sessions can’t have multiple authenticated users

logical sessions can’t have multiple authenticated users

原因是 mongodb 不允许一次会话认证多个用户。

解决方案

退出当前shell窗口,或者新建shell窗口,重新 auth 认证登录

————————

preface

When using mongodb.auth to switch users, the following error is reported

logical sessions can’t have multiple authenticated users

logical sessions can’t have multiple authenticated users

The reason is that mongodb does not allow multiple users to authenticate in one session.

Solution

Exit the current shell window, or create a new shell window and log in again with auth authentication