正文开始
刚开始给我报:Failed to bind properties under 'spring.datasource.type' to java.lang.Class:
加个依赖就阔以了
<dependency> <groupId>com.alibaba</groupId> <artifactId>druid</artifactId> <version>1.0.20</version> </dependency>
加完后又给我报一个错误
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource (这个是重点)[org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Generic.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.sql.DataSource]: Factory method 'dataSource' threw exception; nested exception is java.lang.IllegalStateException: Cannot load driver class: com.mysql.cj.jdbc.Driver