• SpringCloudConfig对称加密 yml配置文件while parsing a block mapping


     

     错误的配置!!!

    #-----------------db------------------
    mybatis:
      type-aliases-package: com.book.product.pojo
      mapper-locations: classpath:com/book/product/mapper/*.xml
    
    spring:
      datasource:
        url: jdbc:mysql:///book-product?useUnicode=true&characterEncoding=utf-8&serverTimezone=UTC
        username: {cipher}24583ad4b96a662ad323fce2e452a7cd9f7c7d276d17511e3e1226398e6b7e92
        password: {cipher}ca62ef4d6b3fec3cbc75aeca077c81c5923131a7874033e40652cb0248bdffd5
        type: com.alibaba.druid.pool.DruidDataSource
        driver-class-name: com.mysql.cj.jdbc.Driver

    报错原因:

    yml文件太严格了!!!

    要在加了 {cipher}的值上加上 '' 单引号!

    正确配置

    #-----------------db------------------
    mybatis:
      type-aliases-package: com.book.product.pojo
      mapper-locations: classpath:com/book/product/mapper/*.xml
    
    spring:
      datasource:
        url: jdbc:mysql:///book-product?useUnicode=true&characterEncoding=utf-8&serverTimezone=UTC
        username: '{cipher}24583ad4b96a662ad323fce2e452a7cd9f7c7d276d17511e3e1226398e6b7e92'
        password: '{cipher}ca62ef4d6b3fec3cbc75aeca077c81c5923131a7874033e40652cb0248bdffd5'
        type: com.alibaba.druid.pool.DruidDataSource
        driver-class-name: com.mysql.cj.jdbc.Driver
  • 相关阅读:
    c++看题
    理想化
    thin mission
    编程时 和 thinking
    tiny mission 2021 10 20
    A Magic Lamp HDU
    Poj 3370
    鸽巢原理(抽屉原理)
    Miller-Rabin质数测试
    Nim or not Nim? HDU
  • 原文地址:https://www.cnblogs.com/arebirth/p/springcloudconfigencryptymlquot.html
Copyright © 2020-2023  润新知