Tag Archives: SpringBoot Microservices

[Solved] SpringBoot Microservices: Failed to configure a DataSource: ‘url‘ attribute is not specified and no embedded dat

Failed to configure the data source: the “url” attribute is not specified, and there is no embedded data source coul

Two methods to solve this error:

The first is to cancel automatic database configuration

@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })

Unconfigure the SpringBootApplication of the startup class

The second is to configure the database information on the configuration file

spring:
  datasource:
    url: jdbc:mysql://localhost:3306/xxxx
    username: root
    password: root
    driver-class-name: com.mysql.jdbc.Driver