报错:

Mon Nov 25 01:09:48 CST 2019
There was an unexpected error (type=Internal Server Error, status=500).
Command failed with error 13 (Unauthorized): 'command update requires authentication' on server 192.168.180.113:27017. The full response is {"ok": 0.0, "errmsg": "command update requires authentication", "code": 13, "codeName": "Unauthorized"}; nested exception is com.mongodb.MongoCommandException: Command failed with error 13 (Unauthorized): 'command update requires authentication' on server 192.168.180.113:27017. The full response is {"ok": 0.0, "errmsg": "command update requires authentication", "code": 13, "codeName": "Unauthorized"}
org.springframework.data.mongodb.UncategorizedMongoDbException: Command failed with error 13 (Unauthorized): 'command update requires authentication' on server 192.168.180.113:27017. The full response is {"ok": 0.0, "errmsg": "command update requires authentication", "code": 13, "codeName": "Unauthorized"}; nested exception is com.mongodb.MongoCommandException: Command failed with error 13 (Unauthorized): 'command update requires authentication' on server 192.168.180.113:27017. The full response is {"ok": 0.0, "errmsg": "command update requires authentication", "code": 13, "codeName": "Unauthorized"}
 
报错的配置:
spring:
application:
name: spring-boot-mongodb
data:
mongodb:
username: test
password: 123456
uri: mongodb://192.168.180.113:27017/test

解决:

spring:
application:
name: spring-boot-mongodb
data:
mongodb:
uri: mongodb://test:123456@192.168.180.113:27017/test

springboot集成mongoDB需要认证的更多相关文章

  1. springboot集成mongoDB 异常认证

    1.springboot连接mongoDB 出现异常认证 异常详情: com.mongodb.MongoSecurityException: Exception authenticating Mong ...

  2. springboot集成轻量级权限认证框架sa-token

    sa-token是什么? sa-token是一个JavaWeb轻量级权限认证框架,主要解决项目中登录认证.权限认证.Session会话等一系列由此衍生的权限相关业务.相比于其他安全性框架较容易上手. ...

  3. SpringBoot集成MongoDB之导入导出和模板下载

    前言 自己很对自己在项目中集成MongoDb做的导入导出以及模板下载的方法总结如下,有不到之处敬请批评指正! 1.pom.xml依赖引入 <!-- excel导入导出 --> <de ...

  4. SpringBoot集成MongoDB

    前言 之前写了各种nosql数据库的比较,以及相关理论,现在我在本地以springboot+MongoDB框架,探究了具体的运行流程,下面总结一下,分享给大家. 运行前准备 安装并启动MongoDB应 ...

  5. springboot 集成mongodb

    环境依赖 在pom文件引入spring-boot-starter-data-mongodb依赖: <dependency> <groupId>org.springframewo ...

  6. SpringBoot 集成mongodb(1)单数据源配置

    新项目要用到mongodb,于是在个人电脑上的虚拟环境linux上安装了下mongodb,练习熟悉下. 1.虚拟机上启动mongodb. 首先查看虚拟机ip地址,忘了哈~~ 命令行>ifconf ...

  7. springboot集成mongoDB简易使用

    1.首先是添加Spring Data mongo的配置依赖 <dependency> <groupId>org.springframework.boot</groupId ...

  8. Springboot集成MongoDB实现CRUD

    特别提示:本人博客部分有参考网络其他博客,但均是本人亲手编写过并验证通过.如发现博客有错误,请及时提出以免误导其他人,谢谢!欢迎转载,但记得标明文章出处:http://www.cnblogs.com/ ...

  9. SpringBoot 集成mongodb(2)多数据源配置

    github:https://github.com/xiaozhuanfeng/mongoProj 现MongoDB有两个数据库: pom.xml: <!-- mongodb 配置 --> ...

随机推荐

  1. Go语言入门篇-使用Beego构建完整web应用

    使用Beego构建完整web应用 一.GO简介(Beego应用go编写) 1.为什么用GO (1).语法简单 (2).简洁的并发 (3).开发和执行效率快(编译型语言) 2.GO语言环境 下载go & ...

  2. JSON.toJSONString时保留null值

    QuoteFieldNames———-输出key时是否使用双引号,默认为true WriteMapNullValue——–是否输出值为null的字段,默认为false WriteNullNumberA ...

  3. 第八周课程总结&实验报告六

    实验六 Java异常 实验目的 理解异常的基本概念: 掌握异常处理方法及熟悉常见异常的捕获方法. 实验要求 练习捕获异常.声明异常.抛出异常的方法.熟悉try和catch子句的使用. 掌握自定义异常类 ...

  4. 期货、股指期权、ETF期权

    期货与期权: 期权是指一种合约,该合约赋予持有人在某一特定日期或该日之前的任何时间以固定价格购进或售出某种资产的权利. 期货是标准化的合约,赋予参与者在未来的某个时间点以约定好的一个价格去买入或者卖出 ...

  5. vscode打开SpringBoot项目

    1.使用vscode打开java项目所在文件夹 2.按ctl+~ 打开命令面板 mvn -Dmaven.test.skip=true spring-boot:run

  6. spring @Value 获取配置文件为 null 常见的几种方式

    第一种方式: xx.properties 属性名称错误,未与@Value("${xxx}") 进行对应 第二种方式: 该类未注入到spring bean容器中 @Component ...

  7. MySQL索引,备份和还原

    1.索引  1.索引是占硬盘空间 ,也是按页存放的 . 思考题:一个索引页,(数据页)  占用多少个字节  .SQL Server 8192个字节 2.索引:是一种有效组合数据的方式,为了快速查找指定 ...

  8. catch that cow POJ 3278 搜索

    catch that cow POJ 3278 搜索 题意 原题链接 john想要抓到那只牛,John和牛的位置在数轴上表示为n和k,john有三种移动方式:1. 向前移动一个单位,2. 向后移动一个 ...

  9. 1000行MySQL学习笔记

    /* 启动MySQL */ net start mysql /* 连接与断开服务器 */ mysql -h 地址 -P 端口 -u 用户名 -p 密码 /* 跳过权限验证登录MySQL */ mysq ...

  10. CSS样式 换行

    强制不换行 div{ white-space:nowrap; } 自动换行 div{ word-wrap: break-word; word-break: normal; } 强制英文单词断行 div ...