spring boot 报错
无法配置DataSource:未指定’url’属性,也无法配置嵌入数据源。
Description:
Failed to configure a ~~DataSource: ‘url’ attribute is not specified and no embedded datasource could be configured.~~
Reason: Failed to determine a suitable driver class
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 (no profiles are currently active).
主要是初学者容易犯的错误
原因是因为这个配置没有配置mysql 或其他数据库的配置但是导乐数据库的依赖
导致数据源找不到
平常是common微服务容易犯得错误
最简单实用的方法是在启动类忽略一下数据源
@SpringBootApplication(exclude= {DataSourceAutoConfiguration.class})