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

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

还是出现在yml文件节点。

具体是druid:这个节点,要有层次结构。详见yml文件。

server:
  port: 8080
spring:
  datasource:
           name: daducha
           type: com.alibaba.druid.pool.DruidDataSource
           druid:
                url: jdbc:mysql://127.0.0.1:3306/daducha
                username: root
                password: root
                maxActive: 20
                initialSize: 1
                maxWait: 60000
                minIdle: 1
                timeBetweenEvictionRunsMillis: 60000
                minEvictableIdleTimeMillis: 300000
                testWhileIdle: true
                testOnBorrow: false
                testOnReturn: false
                poolPreparedStatements: true
                maxOpenPreparedStatements: 20
                driver-class-name: com.mysql.jdbc.Driver
mybatis:
  mapper-locations: classpath:mapping/*.xml
  type-aliases-package: com.wuji.entity.po

 

posted @ 2019-01-02 19:12  Java九阳真经  阅读(1206)  评论(0编辑  收藏  举报