只需要在启动类上的注解@SpringBootApplication中加 (exclude = {DataSourceAutoConfiguration.class})即可 原文:https://blog.csdn.net/weixin_41432270/article/details/83575402