MongoDB连接失败2

来源:9-12 执行系统消息异步收发(一)

慕先生9404427

2022-11-13

老师好,还是MongoDB链接权限问题,我使用的MongoDB是从课程git上的网址下载的,然后版本如下:
图片描述
yml配置,我也又复制了一遍:
图片描述
但只要一运行程序,还是报错没有权限:
org.springframework.data.mongodb.UncategorizedMongoDbException: Command failed with error 13 (Unauthorized): ‘command insert requires authentication’ on server localhost:27017. The full response is {“ok”: 0.0, “errmsg”: “command insert requires authentication”, “code”: 13, “codeName”: “Unauthorized”}; nested exception is com.mongodb.MongoCommandException: Command failed with error 13 (Unauthorized): ‘command insert requires authentication’ on server localhost:27017. The full response is {“ok”: 0.0, “errmsg”: “command insert requires authentication”, “code”: 13, “codeName”: “Unauthorized”}
图片描述
后来就连navicat,我都把用户权限赋上了,但还是insert不上,反复报上图没有认证权限的错误。图片描述
上网差了一些配置方法,尝试过之后仍不好使,想请老师帮忙看一下是哪里出了问题

写回答

1回答

神思者

2022-11-13

你把你本地的MongoDB删除掉,重新下载课程的MongoDB试一下

0
2
慕先生9404427
看了这个网址的解答,https://mongoing.com/anspress/question/mongodb%e5%8d%95%e6%9c%ba%e9%97%ae%e9%a2%98 尝试删掉mongoDB的config文件就好了,但是不知道是什么原因
2022-11-13
共2条回复

SpringBoot 在线协同办公小程序开发 全栈式项目实战

未来趋势型业务 + 前后端综合技术栈 + 惊艳的细节打磨

1798 学习 · 1915 问题

查看课程