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

一.springCloud没有数据库配置信息.

在application.properties/或者application.yml文件中没有添加数据库配置信息.

spring:
  datasource:
    url: jdbc:mysql://localhost:3306/read_data?useUnicode=true&characterEncoding=UTF-8&useSSL=false
    username: root
    password: 123456
    driver-class-name: com.mysql.jdbc.Driver

二.yml或者properties文件没有被扫描到,需要在pom文件中添加如下.来保证文件都能正常被扫描到并且加载成功.



    
        src/main/java
        
            **/*.yml
            **/*.properties
            **/*.xml
        
        false
    
    
        src/main/resources
        
            **/*.yml
            **/*.properties
            **/*.xml
        
        false
    

 

你可能感兴趣的:(错误处理)