To display the conditions report re-run your application with 'debug' enabled.

**Error starting ApplicationContext. To display the conditions report re-run your application with ‘debug’ enabled.
2020-02-19 11:26:29.462 ERROR 4936 — [ restartedMain] o.s.b.d.LoggingFailureAnalysisReporter :


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 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).
Process finished with exit code 0**

这是我引入的依赖:
To display the conditions report re-run your application with 'debug' enabled._第1张图片
To display the conditions report re-run your application with 'debug' enabled._第2张图片
错误原因:原因是加载了数据库依赖而没有写配置文件
解决方法:
1、在SpringBootApplication后加(exclude=DataSourceAutoConfiguration.class)
2、把下面的依赖
org.mybatis.spring.boot mybatis-spring-boot-starter 2.1.1
注释掉

再次运行,报错就没有了。

你可能感兴趣的:(mysql,spring,boot)