Spring boot&Mybatis 启动报错 Failed to auto-configure a DataSource 2018年0

本文介绍了一个新手在使用MyBatis时遇到的数据库连接配置错误问题,并提供了两种解决方案:一是移除pox.xml文件中的MyBatis依赖;二是完成application.properties中的数据库连接配置。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

新手自学入坑,搭建项目启动出错,原因是pox.xml里有mybatis,但application.properties里还没有进行数据库连接配置,所以报错,可以先去除mybatis依赖,或把mybatis数据库连接


  1. ***************************  
  2. APPLICATION FAILED TO START  
  3. ***************************  
  4.   
  5. Description:  
  6.   
  7. Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.  
  8.   
  9. Reason: Failed to determine a suitable driver class  
  10.   
  11.   
  12. Action:  
  13.   
  14. Consider the following:  
  15.     If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.  
  16.     If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).  

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值