项目场景:

场景:继上回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. Windows 11 ISO原版镜像文件下载(2024年01月)

    Windows 11 (business editions), version 23H2 (x64) - DVD (Chinese-Simplified) 链接:https://pan.baidu.c ...

  2. 小知识:Flex ASM特性对集群资源显示的影响

    有客户咨询,认为19c RAC集群资源状态和11g RAC大不一样,比如在他们的19c集群,也是只部署2节点,却显示3个资源状态,其中第三个还是offline状态,担心是否有影响. 实际上这和Flex ...

  3. 大数据生态组件WEB UI地址汇总

    (1) Hadoop Web UI http://master-1:50070/dfshealth.html#tab-overview (2) YARN应用Web UI http://master-1 ...

  4. Ubuntu安装PHP和NGINX环境

    Ubuntu安装PHP和NGINX环境 介绍 PHP-FPM PHP-FPM 是 PHP FastCGI Process Manager 的缩写,是 FastCGI 进程管理器. PHP-FPM 是基 ...

  5. JS Leetcode 81. 搜索旋转排序数组 II 题解,补救二分法的可行性

    壹 ❀ 引 今日LeetCode题为153. 寻找旋转排序数组中的最小值,在10个月前,我已在JS leetcode 寻找旋转排序数组中的最小值 题解分析,你不得不了解的二分法一文中写了本题的题解,所 ...

  6. NC20284 [SCOI2011]糖果

    题目链接 题目 题目描述 幼儿园里有N个小朋友,lxhgww老师现在想要给这些小朋友们分配糖果,要求每个小朋友都要分到糖果.但是小朋友们也有嫉妒心,总是会提出一些要求,比如小明不希望小红分到的糖果比他 ...

  7. NC50439 tokitsukaze and Soldier

    题目链接 题目 题目描述 在一个游戏中,tokitsukaze需要在n个士兵中选出一些士兵组成一个团去打副本. 第i个士兵的战力为v[i],团的战力是团内所有士兵的战力之和. 但是这些士兵有特殊的要求 ...

  8. Centos8 安装 MySQL8.0.26

    下载 访问 https://dev.mysql.com/downloads/mysql/ 选择 Red Hat Enterprise Linux / Oracle Linux 选择 Red Hat E ...

  9. java常用包下载地址(非maven)

    httpclient与httpcore: http://hc.apache.org/downloads.cgi jdbc: https://dev.mysql.com/downloads/connec ...

  10. 超详细的 springboot & mybatis 程序入门

    ps:网上有很多类似的入门案例,我也是看了被人的之后自己写的一个 估计有哥们懒 我把数据表格拿上来,数据自己填吧 CREATE TABLE `tb_user` ( `id` int(10) DEFAU ...