为了账号安全,请及时绑定邮箱和手机立即绑定

没有使用数据库,它运行报错

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


正在回答

4 回答

https://img1.sycdn.imooc.com//5d26f2be000130b706410172.jpg???

0 回复 有任何疑惑可以回复我~

https://img1.sycdn.imooc.com//5d26f17500011b2709860356.jpg还是不行啊

0 回复 有任何疑惑可以回复我~

这是怎么解决的呀,兄弟

0 回复 有任何疑惑可以回复我~


//因为  springboot启动时会自动注入数据源和配置jpa 
//所以  在@SpringBootApplication中排除其注入 
@SpringBootApplication(exclude={DataSourceAutoConfiguration.class,HibernateJpaAutoConfiguration.class})


1 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

没有使用数据库,它运行报错

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信