java.lang.Object.wait(Native Method)
java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:143)
com.mysql.jdbc.AbandonedConnectionCleanupThread.run(AbandonedConnectionCleanupThread.java:43)
2018-07-24 15:58:43.126 INFO 7888 --- [ main] ConditionEvaluationReportLoggingListener :
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2018-07-24 15:58:43.151 ERROR 7888 --- [ main] 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 1
还有一个就是如果你是按照视频敲的代码,开始勾选了mybatis,而你在pom.xml里没有注释掉,就用上边的那个方法配置数据库。但是如果你没有注释掉pom.xml里面的mybatis,注释掉之后新建hello类,就可以运行了
配置src\main\resources\application.properties
spring.datasource.url=jdbc:mysql\://192.168.0.20\:1504/f_me?setUnicode=true&characterEncoding=utf8 spring.datasource.username=****** spring.datasource.password=******
我也是这个问题,用了楼上的方法还是没用
因为还没有配置数据源 在@SpringBootApplication 注解后 添加 exclude = DataSourceAutoConfiguration.class 再运行