datasource:
druid:
driver-class-name: ${sky.datasource.driver-class-name}
url: jdbc:mysql://${sky.datasource.host}:${sky.datasource.port}/${sky.datasource.database}?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
username: ${sky.datasource.username}
password: ${sky.datasource.password}

上述是黑马程序员苍穹外卖的yml里的druid配置,我复制在另一个项目的时候报错

Description:
Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.
Reason: Failed to determine a suitable driver class
Action:
Consider the following:
    If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.
    If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).
Process finished with exit code 1
后来发现是因为我新的项目用的是springboot3,而这个老项目用的2,很多人都说降版本可以解决,当然也可以改成下面:将druid放在type里

  datasource:
driver-class-name: ${datasource.driver-class-name}
url: jdbc:mysql://${datasource.host}:${datasource.port}/${datasource.database}?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
username: ${datasource.username}
password: ${datasource.password}
type: com.alibaba.druid.pool.DruidDataSource

关于druid与springboot版本问题的更多相关文章

  1. alibaba druid 在springboot start autoconfig 下的bug

    alibaba druid 在springboot start autoconfig下的bug 标签(空格分隔):druid springboot start autoconfig 背景 发现.分析过 ...

  2. SpringCloud 与 SpringBoot版本问题

    如果SpringBoot版本与SpringCloud版本不一致,SpringBoot应用启动会报错: 解决方案: 版本对应关系可以在 https://start.spring.io/info 上查看: ...

  3. Spring Cloud Alibaba (一): SpringCloud与SpringBoot版本选型

    前言   近年SpringCloud与SpringBoot更新迭代非常频繁,导致我们对两者的版本选型非常的困难.若是版本选择有问题, 会导致开发中调试兼容性占用非常多的得必要时间. SpringClo ...

  4. 升级了Springboot版本后项目启动不了了

    问题背景 项目上使用的springboot版本是2.1.1.RELEASE,现在因为要接入elasticsearch7.x版本,参考官方文档要求,需要将springboot版本升级到2.5.14. 本 ...

  5. session共享问题、springboot 版本不统一问题

    问题:按照正常的程序将session 共享引入工程,但是一直取不到 原因:springboot 的版本不同导致,存session的springboot 用的是springboot1.5.6,而取ses ...

  6. 【SpringBoot | Druid】SpringBoot整合Druid

    SpringBoot整合Druid Druid是个十分强大的后端管理工具,具体的功能和用途请问阿里爸爸 1. 在pom.xml中导入包 <!-- alibaba 的druid数据库连接池 --& ...

  7. 使用Druid作为SpringBoot项目数据源(添加监控)

    Druid是一个关系型数据库连接池,它是阿里巴巴的一个开源项目.Druid支持所有JDBC兼容数据库,包括了Oracle.MySQL.PostgreSQL.SQL Server.H2等.Druid在监 ...

  8. 微信扫码支付springboot版本

    发布时间:2018-11-06   技术:springboot+freemarker   概述 该项目是一个采用springboot构建的web项目,主要实现了微信扫码支付功能.包含最基本的创建订单, ...

  9. Springboot 版本+ jdk 版本 + Maven 版本的匹配

    Spring boot 版本 Spring Framework jdk 版本 maven 版本 1.2.0 版本之前 6 3.0 1.2.0 4.1.3+ 6 3.2+ 1.2.1 4.1.3+ 7 ...

  10. Springboot 版本+ jdk 版本 + Maven 版本的对应关系

    Spring boot 版本 Spring Framework jdk 版本 maven 版本 1.2.0 版本之前   6 3.0 1.2.0 4.1.3+ 6 3.2+ 1.2.1 4.1.3+ ...

随机推荐

  1. .net core 下 DES &MD5加密

    項目中經常會用到加密解密,分享 DES & MD5加密,當然我們建議使用MD5. #region DES encrypt, decrypt public string EncryptDES(s ...

  2. PaddleOCR在 windows下的webAPI部署方案

    很多小伙伴在使用OCR时都希望能过采用API的方式调用,这样就可以跨端跨平台了.本文将介绍一种基于python的PaddleOCR识方案.喜欢的可以关注公众号,获取更多内容. # 一. windows ...

  3. 基于centos7的企业级ceph集群搭建[nautilus14.22版]

    集群规划 本案例通过ceph-deploy方式部署 主机名 配置 外网IP / 内网IP 角色 系统版本 ceph-node01 磁盘x3 50G 192.168.3.101/24 172.16.1. ...

  4. cors解决跨域 服务器代理方式

    // cors 方法         // 后端程序员通过定义后端程序,让跨域访问,可以正常执行,可以获取响应体内容         // 前端程序员不需要做任何的调整         // 后端程序 ...

  5. 关于excel表

    对excel表的操作主要通过xlwt,xlrd模块. 创建excel表 import xlwtworkbook = xlwt.Workbook(encoding='utf-8') worksheet ...

  6. SpringBoot3整合SpringDoc实现在线接口文档

    写在前面 在现目前项目开发中,一般都是前后端分离项目.前端小姐姐负责开发前端,苦逼的我们负责后端开发 事实是一个人全干,在这过程中编写接口文档就显得尤为重要了.然而作为一个程序员,最怕的莫过于自己写文 ...

  7. 2019 香港区域赛 BDEG 题解

    B.Binary Tree 题意:给你一棵二叉树.有两个游戏者,回合制,他们每次可以删去这棵二叉树中的一棵满二叉树.求最后谁赢. 解法:每一棵满二叉树有奇数个节点,那么每次游戏者只能删去奇数个节点,所 ...

  8. 3.8折钜惠,瑞芯微RK3568J国产工业评估板“限时折扣”!

  9. 一个JVM参数,服务超时率降了四分之三

    先说结论:通过优化Xms,改为和Xmx一致,使系统的超时率降了四分之三 1. 背景 一个同事说他负责的服务在一次上线之后超时率增加了一倍 2. 分析 2.1 机器的监控 首先找了一台机器,看了监控 上 ...

  10. Mysql 添加字段、修改字段、删除字段、新增

    导读 Mysql数据类型,点我直达 创建表 语法: create table 表名( 字段名1 字段类型2 约束条件1 说明1, 字段名2 字段类型2 约束条件2 说明2 ) 约束条件: commen ...