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. Postman POST多个文件

    软件做的比较好用,

  2. .net formwork WebApi 跨域问题

    背景: ASP.NET Formwork  Api / ASP.Net Core Api  做比较. 有关  Global.asax.FilterConfig.cs 和 RouteConfig.cs ...

  3. Linux扩展篇-shell编程(五)-流程控制(一)-if语句

    基本语法: (1)单分支 if [ condition ];then statement(s) fi 或 if [ condition ] then statement(s) fi (2)多分支 if ...

  4. (编程语言界的丐帮 C#).NET Framework 读取Excel到DataTable

    (编程语言界的丐帮 C#).NET Framework 读取Excel到DataTable 生成DataTable到Excel,支持 2007 .xlsx,2003 .xls. nuget 引用 NP ...

  5. 百度面试:如何用Redis实现限流?

    高并发系统有三大特征:限流.缓存和熔断,所以限流已经成为当下系统开发中必备的功能了.那么,什么是限流?如何实现限流?使用 Redis 能不能实现限流?接下来我们一起来看. 1.什么是限流? 限流是指在 ...

  6. Json输出List集合对象和map对象 JSON格式

    Json输出List集合对象和map对象 JSON格式 //Json输出List集合对象 [{"属性1":["值1"],"属性2":&quo ...

  7. IDEA生成类和方法注释模板详细说明 绝对好用

    吐槽 今天心血来潮,将使用了很久的IDEA旗舰版卸载了,想换社区版用一段时间,毕竟社区版开源免费.精简不卡顿,如果够用的话以后就省去了破解的烦恼,而且可以紧跟官网使用最新版 旧的IDEA配置忘记保存了 ...

  8. typroa破解

    Typora 一款 Markdown 编辑器和阅读器 风格极简 / 多种主题 / 支持 macOS,Windows 及 Linux 实时预览 / 图片与文字 / 代码块 / 数学公式 / 图表 目录大 ...

  9. PyTorch程序练习(一):PyTorch实现CIFAR-10多分类

    一.准备数据 代码 import torchvision import torchvision.transforms as transforms from torch.utils.data impor ...

  10. Android发布,全志T507四核A53@1.4GHz工业平台,含税仅168元起!

    近年来,Android系统在工业自动化.仪器仪表.医疗.安防等工业领域的使用日趋广泛.为了满足广大工业用户的需求,创龙科技针对全志T507-H工业平台进行了Android系统适配. 创龙科技T507- ...