mongostat 报错:"authenticationDatabase is required" 解决方法
使用 mongostat 命令时遇到 'authenticationDatabase is required' when authenticating against a non $external database 错误,是因为在连接非 $external 数据库时,需要指定 --authenticationDatabase 参数来进行身份验证。
您可以使用以下命令来解决问题:
mongostat --host <hostname> --port <port> --username <username> --password <password> --authenticationDatabase <authenticationDatabase>
其中:
<hostname>是 MongoDB 服务器的主机名或 IP 地址<port>是 MongoDB 服务器的端口号<username>和<password>是用于身份验证的用户名和密码<authenticationDatabase>是用于身份验证的数据库名称
如果仍然遇到问题,请检查您的 MongoDB 服务器是否已启用身份验证,并确认您的用户名和密码是否正确。
原文地址: https://www.cveoy.top/t/topic/mQVU 著作权归作者所有。请勿转载和采集!