Springboot启动时报错 If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.
产生这个错误的原因是springboot的自动配置,如果你没有配置DataSource就会导致下图这个错误
如果你是要连数据库的话那就在yml或properties文件下配置数据库的账户密码地址

不想连接数据库的话有以下解决方案
解决方案1
@SpringBootApplication(exclude = DataSourceAutoConfiguration.class)//排除自动配置 public class ErukaServerMain {
public static void main(String[] args) {
SpringApplication.run(ErukaServerMain.class,args); } }
解决方案2
如果以上方法不行那就,将pom文件带有数据库相关的删除,例如:jdbc、mysql-connect等等
发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/201192.html原文链接:https://javaforall.net
