快速创建springboot项目的时候,并且在创建项目的时候选择了自动添加数据源,数据驱动,还有mybatis,然后项目启动报错:
// 报错信息
Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.
在启动类上加上这个注解
@SpringBootApplication(exclude={DataSourceAutoConfiguration.class})
// 添加上这个之后,取消数据库自动配置,项目不报错