当前位置:网站首页>Failed to configure a DataSource: ‘url‘ attribute is not specified and no embedded datasource could
Failed to configure a DataSource: ‘url‘ attribute is not specified and no embedded datasource could
2022-06-26 06:12:00 【Oh No 发量又少了】
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
配置数据源失败:未指定“url”属性,无法配置嵌入的数据源。
原因:未能确定合适的驱动程序级别
报错解决方案
1. @SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
exclude,排除此类的AutoConfig,即禁止 SpringBoot 自动注入数据源配置
2. 配置数据源
- 首先导入pom中的依赖
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
- 在application.yml文件中配置连接数据库
spring:
datasource:
url: jdbc:mysql://localhost:3306/blogsys?useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC
username: root
password: qwer
driver-class-name: com.mysql.jdbc.Driver
边栏推荐
猜你喜欢

Install pyinstaller

TCP connection and disconnection, detailed explanation of state transition diagram

Underlying principle of MySQL index

Five solutions across domains

Younger sister Juan takes you to learn JDBC -- two days' Sprint Day2

Transaction and message semantics

MobileNets: Efficient Convolutional Neural Networks for Mobile Vision Applications

温度报警器

Gof23 - builder mode

Logstash -- send an alert message to the nail using the throttle filter
随机推荐
数据可视化实战:数据可视化
Message queue - function, performance, operation and maintenance comparison
Summary of JVM interview focus (II) -- garbage collector (GC) and memory allocation strategy
Bubble sort
Redis underlying data structure
Explore small program audio and video calls and interactive live broadcast from New Oriental live broadcast
技术Leader的思考技巧
消息队列-全方位对比
01 golang and matlab code of knapsack problem
卷妹带你学jdbc---2天冲刺Day2
Import / export function implementation
Redis多线程与ACL
Handwritten background management framework template (I)
Laravel 实现 groupBy 查询分组数量
Web components series (10) -- realize the basic layout of mycard
DPDK——TCP/UDP协议栈服务端实现(二)
"= =" difference from "equals"
Evolution history of qunar Bi platform construction
Message queue - message transaction management comparison
Solve the problem that Cmdr cannot use find command under win10