1. 程式人生 > >SpringBoot啟動報錯

SpringBoot啟動報錯

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檔案內配置資料來源即可。程式碼如下:

 
 
  1. spring.datasource.url=jdbc:mysql://localhost:3306/test

  2. spring.datasource.username=root

  3. spring.datasource.password=123456

  4. spring.datasource.driver-class-name=com.mysql.jdbc.Driver

  5. spring.datasource.max-idle=10

  6. spring.datasource.max-wait=10000

  7. spring.datasource.min-idle=5

  8. spring.datasource.initial-size=5