报错:

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. 浅谈JVM及原理

    前言 JVM一直是java知识里面进阶阶段的重要部分,如果希望在java领域研究的更深入,则JVM则是如论如何也避开不了的话题,本系列试图通过简洁易读的方式,讲解JVM必要的知识点. 运行流程 我们都 ...

  2. redis学习(二)

    深入了解redis字符串,列表,散列和有序集合命令,了解发布,订阅命令和其他命令.   一,字符串   1.字符串可以存储3种类型的值 字符串,整数,浮点数 2.运算命令列表 incr : incr ...

  3. redis配置主从出现DENIED Redis is running in protected mode

    修改redis配置文件,将绑定的ip给注释掉 #127.0.0.1 在配置文件中将protected-mode 改为no protected-mode no 另一种方式是在配置文件中设置密码 requ ...

  4. HashMap中确定数组位置为什么要用hash进行扰动

    HashMap数据存储的过程先根据key获得hash值,通过 (n - 1) & hash 判断当前元素存放的位置(这里的 n 指的是数组的长度),如果当前位置存在元素的话,就判断该元素与要存 ...

  5. c语言中不允许在函数外部给全局变量赋值

    今天,在写条件编译的时候,出现了在函数外部给全局变量赋值的情况,gcc报错,那么c语言为什么不允许在函数外部给变量赋值呢?为什么声明变量的时候可以对变量进行赋值? 出错代码: /* 2 * ===== ...

  6. Vue-cli3 简qian易yi教程

    原文地址 对于没有了解过 vue-cli3 的童鞋,建议先去看看官方的教程: 传送门 新版本的新特性 1. 插件 使用 cli 的插件,可以很快的搭建一个项目的结构.如 axios 的插件 vue-c ...

  7. 给Repeater增加button事件,并绑定值

    ASPX页面: 增加两个事件,及传值. 1<asp:Repeater ID="rptList" OnItemDataBound="rptList_ItemDataB ...

  8. CentOS服务器开放端口

    拿到服务器之后接着之前的通信步骤进行,却发现怎么也连接不上.最后发现是因为服务器端的端口5000没有开放.下面记录一下开放端口的过程. 使用命令 netstat -anp 查看端口开放情况.如果显示命 ...

  9. 【学习总结】快速上手Linux玩转典型应用-第4章-准备工作

    课程目录链接 快速上手Linux玩转典型应用-目录 目录 1. 准备工作一 2. 准备工作二 ===================================================== ...

  10. HTML的条件注释及hack技术

    在很多时候,前端的兼容性问题,都很让人头痛!幸运的是,微软从去年声明:从2016年1月12日起,微软将停止为IE8(包括IE8)提供技术支持和安全更新.整个前端圈子都沸腾起来,和今年七月份Adobe宣 ...