项目场景:

场景:继上回docker安装好了mongo,然后自己本地项目尝试搭建使用连接mongo


问题描述:

按照别人写的文章教程一步步操作,最后自己本地尝试连接查询,跳出这个用户权限不够,发生了套接字异常。就很郁闷了,明明本地的navicat就是用的这个用户名和密码都能连接上,且能看到这个数据库,为什么在项目中就不行了。报错信息如下图:

大概意思就是权限不对,我尝试了其他教程说先use admin,然后新增个用户,再修改配置重新连接还是报这个错啊。知道看到这个小哥写的文章才恍然大悟,于是自己去use下我要查的数据库,然后在这个数据库下新增个用户,再修改配置启动项目,发现果然可以了。立刻三连了他


原因分析:

自己对mongo DB用户权限这块不熟悉导致


总结:

遇到问题首先要去了解这个东西的基础是啥样的,然后再从字面意思理解报错是啥问题,经过分析后找百度会更加有效率

记springBoot一直报Exception authenticating MongoCredential.的更多相关文章

  1. MongoDB查询报错:class com.mongodb.MongoSecurityException: Exception authenticating MongoCredential

    异常日志: -- ::, [http-nio--exec-] DEBUG [java.sql.Connection] - ooo Connection Opened -- ::, [http-nio- ...

  2. 【MongoDB异常】Exception authenticating MongoCredential解决方法

    我们通过ideal编辑器编辑 springboot时候,出现这个错误: com.mongodb.MongoSecurityException: Exception authenticating Mon ...

  3. springboot 启动报错"No bean named 'org.springframework.context.annotation.ConfigurationClassPostProcessor.importRegistry' available"

    1.问题 springboot启动报错 "D:\Program Files\Java\jdk-11\bin\java.exe" -XX:TieredStopAtLevel=1 -n ...

  4. springboot启动报错 Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.

    新建了一个springboot项目报一下错误: Failed to configure a DataSource: 'url' attribute is not specified and no em ...

  5. 运行springboot项目报错:Field userMapper in XX required a bean of type 'xx' that could not be found.

    运行springboot项目报错: *************************** APPLICATION FAILED TO START ************************** ...

  6. SpringBoot启动报错Failed to determine a suitable driver class

    SpringBoot启动报错如下 Error starting ApplicationContext. To display the conditions report re-run your app ...

  7. nginx反向代理部署springboot项目报404无法加载静态资源

    问题:nginx反向代理部署springboot项目报404无法加载静态资源(css,js,jpg,png...) springboot默认启动端口为8080,如果需要通过域名(不加端口号)直接访问s ...

  8. SpringBoot启动报错:ould not be registered. A bean with that name has already been defined in file and overriding is disabled.

    SpringBoot启动报错 ***************************APPLICATION FAILED TO START*************************** Des ...

  9. springboot启动报错 Failed to scan *****/derbyLocale_ja_JP.jar from classloader hierarchy

    springboot启动报错 Failed to scan *****/derbyLocale_ja_JP.jar from classloader hierarchy   这两天自己在玩虚拟机,想把 ...

  10. springboot启动报错:Handler dispatch failed; nested exception is java.lang.AbstractMethodError

    最近在用springboot构建项目,控制台报错:Handler dispatch failed; nested exception is java.lang.AbstractMethodError, ...

随机推荐

  1. elasticsearch源码debug

    一.下载源代码 直接用idea下载代码https://github.com/elastic/elasticsearch.git 切换到特定版本的分支:比如7.17,之后idea会自己加上Run/Deb ...

  2. ElasticSearch7.3学习(十六)----RestHighLevelClient Java api实现索引的创建、删除、是否存在、关闭、开启

    1.写在前面 注意:导入的包区别,不同的包创建索引的方式不同.博主亲身实践,具体体现在createIndexRequest.mapping()里面.读者可自行试验. import org.elasti ...

  3. OSW Analyzer分析oswbb日志发生异常

    具体OSW Analyzer详细介绍可以参考MOS文档: OSWatcher Analyzer User Guide (Doc ID 461053.1) 我们常用的就是拿到一份osw数据到自己电脑,使 ...

  4. macOS 远程桌面windows方法

    1.利用微软官方的软件:https://learn.microsoft.com/en-us/windows-server/remote/remote-desktop-services/clients/ ...

  5. 【译】发布 .NET Aspire 预览版 2(二)

    原文 | Damian Edwards 翻译 | 郑子铭 组件更新 组件包现在有单独的图标 大多数 Aspire 组件的 NuGet 包现在都具有代表性图标,以便在 NuGet 包管理器对话框中更轻松 ...

  6. ABC 332

    ABCDF 都赛时做出来了. E \(\displaystyle\dfrac{1}{D}\sum_{i=1}^D (x_i-\overline{x})^2=\dfrac{1}{D}(\sum_{i=1 ...

  7. Go 和 Colly笔记

    Colly是Go下功能比较完整的一个HTTP客户端工具. 安装 Win10 下载zip包, 直接解压至c:根目录. 如果不打算直接命令行使用, 可以不配置环境变量 Ubuntu 下载tar.gz, 解 ...

  8. java 打包jar文件实战

    本文只介绍实用步骤,预备知识请自查阅: 参考资料: http://docs.oracle.com/javase/tutorial/deployment/jar/appman.html http://w ...

  9. Oracle 中UNDO与REDO的区别详解

    一 为了更清楚的看出2者区别,请看下表: UNDO                                                                   REDO Rec ...

  10. 如何用Apipost校验响应结果

    数据校验的意义 我们可以通过 json-schema 预先定义接口的数据返回格式,当接口完成后,我们可以通过匹配 实际响应结果 和 预先定义的接口格式 ,来发现接口问题.如下图: 数据校验的设置 我们 ...