Problem Description:
An error was encountered while springboot was starting:
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2021-10-09 16:10:19.148 ERROR 3668 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter :
***************************
APPLICATION FAILED TO START
***************************
Description:
Failed to bind properties under '' to com.zaxxer.hikari.HikariDataSource:
Property: driver-class-name
Value: com.mysql.cj.jdbc.Driver
Origin: "driverClassName" from property source "source"
Reason: java.lang.RuntimeException: Failed to load driver class com.mysql.cj.jdbc.Driver in either of HikariConfig class loader or Thread context classloader
Action:
Update your application's configuration
Cause analysis:
When testing springboot, the default is H2 database, and I use mysql, so I need to specify it in application.properties
Solution:
Specify the following in application.properties
spring.datasource.driver-class-name=com.mysql.jdbc.Driver