当前位置:   article > 正文

Spring boot 连接mongodb 报错 Command failed with error 18: 'Authentication failed.'_command failed with error 18 (authenticationfailed

command failed with error 18 (authenticationfailed): 'authentication failed.

控制台报“Command failed with error 18: ‘Authentication failed.’”只需在所需要操作的数据库中添加一个用户,具体操作方式如下

db.createUser({user:"userName",pwd:"userPassword",roles:[{role:"readWrite",db:"dbName"}]})
  • 1
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Gausst松鼠会/article/detail/701611
推荐阅读
相关标签
  

闽ICP备14008679号