• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
公子缘
博客园    首页    新随笔    联系   管理    订阅  订阅

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

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

 

若现在就觉得失望无力,未来那么远你该怎么扛 —— 致自己
posted @ 2019-09-09 20:56  公子缘  阅读(646)  评论(0)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3