架构师_程序员_码农网

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 6165|回复: 0

[资料] springboot创建项目后运行报错:Failed to configure a DataSource

[复制链接]
发表于 2019-2-20 13:19:05 | 显示全部楼层 |阅读模式

springboot创建项目后运行报错【Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.】

摘自:https://www.cnblogs.com/WeiMJ/p/9180159.html

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).

这是因为项目刚创建成功,还没有配置数据源,所以无法指定url

可以再启动类的注解@SpringBootApplication()中加上参数

如下即可:


这样就不会报错了!




上一篇:springboot hibernate 中各种数据库的连接设置
下一篇:【实战】spring boot hibernate druid mysql项目搭建教程[附源码]
码农网,只发表在实践过程中,遇到的技术难题,不误导他人。
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则

免责声明:
码农网所发布的一切软件、编程资料或者文章仅限用于学习和研究目的;不得将上述内容用于商业或者非法用途,否则,一切后果请用户自负。本站信息来自网络,版权争议与本站无关。您必须在下载后的24个小时之内,从您的电脑中彻底删除上述内容。如果您喜欢该程序,请支持正版软件,购买注册,得到更好的正版服务。如有侵权请邮件与我们联系处理。

Mail To:help@itsvse.com

QQ|手机版|小黑屋|架构师 ( 鲁ICP备14021824号-2 )|网站地图

GMT+8, 2024-4-19 14:19

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表