zoukankan      html  css  js  c++  java
  • 报错:Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.

    报错原因:无法配置DataSource:未指定'url'属性,也无法配置嵌入数据源。

    解决方法:

    在应用中没有配置datasource的一些相关属性,例如:地址值啊,数据库驱动啊,用户名啊,密码啊

    在application.properties 中添加相关属性

    spring:
      datasource:
        password: root
        username: root
        url: jdbc:mysql://localhost:3306/vip?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
        driver-class-name: com.mysql.jdbc.Driver
    mybatis-plus:
    mapper-locations: classpath*:/mapper/**/*.xml
    global-config:
    db-config:
    id-type: auto
    @EnableDiscoveryClient
    @SpringBootApplication(exclude = DataSourceAutoConfiguration.class)    //添加该注解
    public class VipstoreGatewayApplication {
  • 相关阅读:
    QTableWidget清空
    SQLite查询表是否存在
    QSplitter测试
    Qto_CoveringBaseQuantities
    osg旋转
    Qto_CurtainWallQuantities
    没有理清的一段代码
    方块
    Qto_DoorBaseQuantities
    全微分在近似计算中的应用
  • 原文地址:https://www.cnblogs.com/Lvzx233/p/14180894.html
Copyright © 2011-2022 走看看