SpringBoot啟動報錯
阿新 • • 發佈:2018-11-29
SpringBoot啟動報錯:Cannot determine embedded database driver class for database type NONE
springboot啟動時會自動注入資料來源和配置jpa
解決辦法一:啟動類中加入註解:@SpringBootApplication(exclude={DataSourceAutoConfiguration.class,HibernateJpaAutoConfiguration.class})
原文地址:http://blog.csdn.net/shangquan2012/article/details/74935314 點選開啟連結
解決方法二:在Application.properties檔案內配置資料來源即可。程式碼如下:
-
spring.datasource.url=jdbc:mysql://localhost:3306/test
-
spring.datasource.username=root
-
spring.datasource.password=123456
-
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
-
spring.datasource.max-idle=10
-
spring.datasource.max-wait=10000
-
spring.datasource.min-idle=5
-
spring.datasource.initial-size=5