首页 > 数据库技术 > 详细

Springboot 之 启动报错-Cannot determine embedded database driver class for database type NONE

时间:2019-09-09 21:04:21      阅读:133      评论:0      收藏:0      [点我收藏+]

Springboot 之 启动报错-数据库

  springboot项目在启动时,报如下错误:

Error starting ApplicationContext. To display the auto-configuration report re-run your application with ‘debug‘ enabled.
2019-09-09 20:47:28.395 ERROR 16240 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   : 

***************************
APPLICATION FAILED TO START
***************************

Description:

Cannot determine embedded database driver class for database type NONE

Action:

If you want an embedded database please put a supported one on the classpath. If you have database settings to be loaded from a particular profile you may need to active it (no profiles are currently active).

 

  原因:

    在项目的pom.xml文件中有引入数据库的配置,如下,但在实际上在项目中没有配置数据库的链接,所以报错。

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-jdbc</artifactId>
        </dependency>            

  解决方案:

    在项目的application.properties配置数据库的链接。

spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.url=jdbc:mysql://127.0.0.1:3306/cds
spring.datasource.username=cds
spring.datasource.password=cds

 

Springboot 之 启动报错-Cannot determine embedded database driver class for database type NONE

原文:https://www.cnblogs.com/Charles-Yuan/p/11494202.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!