解决方案: 启动类的@SpringBootApplication中加一个属性 @SpringBootApplication(exclude = DataSourceAutoConfiguration.class)