【问题标题】:UserNotFound: Could not find user admin@automationUserNotFound:找不到用户 admin@automation
【发布时间】:2018-10-26 00:23:58
【问题描述】:

我正在尝试按如下方式启动 Mongodb 实例并遇到如下错误,我该如何调试?请提供有关如何修复此错误的指导

mongo automation --host machine40.scv.company.com -u admin -p passd

2018-05-15T21:11:30.346-0700 I ACCESS   [conn3] SCRAM-SHA-1 authentication failed for admin on automation from client 17.xxx.xxx.x:54756 ; UserNotFound: Could not find user admin@automation

【问题讨论】:

  • 添加 --authenticationDatabase automation 或您实际创建用户的任何位置。您确实“应该”在 admin 数据库中创建用户,但您已经在不同的数据库中创建了它,因此您需要指定是哪个数据库。
  • @Jeremyapple 连接 mongo 服务器的命令将 username 作为 admin 并将 password 作为 passd,此用户正在通过 automation 数据库进行身份验证。 Mongo 错误显示用户 admin 未在自动化数据库下创建找不到用户 admin@automation。使用创建用户名 admin 的数据库。此外,正如 Neil 在上述评论中提到的那样,使用新标准 --authenticationDatabase automation
  • 例如:mongo --port 27017 -u "myUserAdmin" -p "abc123" --authenticationDatabase "admin" 有用的链接:stackoverflow.com/questions/4881208/…

标签: mongodb


【解决方案1】:

请参考以下步骤。

1) 以超级管理员用户身份登录 mongo 控制台。

mongo admin --host machine40.scv.company.com -u admin -p passd

2) 然后检查,是否有任何用户调用管理员可以进行身份​​验证以访问“自动化”数据库。 下面给出的示例输出

{
    "_id" : "XXXXXX",
    "user" : "admin",
    "db" : "automation",
    "roles" : [
        {
            "role" : "root",
            "db" : "automation"
        }
    ]
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-11-27
    • 2011-02-09
    • 2016-09-05
    • 1970-01-01
    • 1970-01-01
    • 2011-05-09
    • 2017-10-18
    • 2019-07-05
    相关资源
    最近更新 更多