抽象springBoot报错

Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.

中文翻译:无法配置DataSource:未指定“url”属性,并且无法配置嵌入数据源。

DataSource 翻译:数据源

得出一个结论,这个问题是springboot项目添加了mybits,但是没有连接数据库导致的

解决方法

第一步,找到Springboot生成的resources资源文件,application文件,默认生成的不是yaml格式

抽象springBoot报错_第1张图片

第二步,将这段代表输入进去

spring:
    datasource:
    	url: jdbc:mysql://IPV4:3306/
    	username: root
    	password: 123456
    	driver-class-name: com.mysql.cj.jdbc.Driver

本质上就是连接数据库,只要能连接到数据库这个bug就解决了

username,password根据自己的数据库去修改

ipv4,用终端输入ipconfig即可,当然本地连接可用使用127.0.0.1进行代替

你可能感兴趣的:(spring,boot,java,mybatis)