boot版本配置多数据库失败

Blade 未结 4 1236
18894961962
18894961962 2022-07-13 18:04

一、该问题的重现步骤是什么?

  1. autoconfigure:
        exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure
      datasource:
        dynamic:
          primary: master
          strict: false
          datasource:
            master:
              url: jdbc:mysql://*****************?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
              username: *****************
              password: *****************
            slave:
              url: jdbc:mysql://*****************?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
              username: *****************
              password: *****************

***************************

APPLICATION FAILED TO START

***************************


Description:


Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.


Reason: Failed to determine suitable jdbc url



Action:


Consider the following:

If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.

If you have database settings to be loaded from a particular profile you may need to activate it (the profiles dev are currently active).

3.boot版本2.9.1版本配置多数据库时启动失败


二、你期待的结果是什么?实际看到的又是什么?


三、你正在使用的是什么产品,什么版本?在什么操作系统上?


四、请提供详细的错误堆栈信息,这很重要。


五、若有更多详细信息,请在下面提供。


4条回答
  •  赞灬小奈
    2022-07-14 09:24

    我也遇到相同问题,如果解决了,请回复我下。如果我先解决我也会来帖子留言的

提交回复