zoukankan      html  css  js  c++  java
  • springboot集成mongoDB需要认证

    报错:

    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
  • 相关阅读:
    2016 Multi-University Training Contest 1 solutions BY HIT
    Unicode 码表
    用 lambda 表达式 对 List 进行排序
    Linux的sed命令介绍
    Linux下的NTP服务搭建
    Linux网络配置(ip命令及配置文件)
    Linux的bash脚本编程(if语句和循环语句)
    Linux新手必须掌握的命令(2)
    Linux的文件查找
    bash中的变量
  • 原文地址:https://www.cnblogs.com/dalianpai/p/11925480.html
Copyright © 2011-2022 走看看