application.properties 需要加入下面参数,否则 @Bean 不允许。
spring.main.allow-bean-definition-overriding=true
另外 MySQL驱动必须使用最新的 com.mysql.cj.jdbc.Driver