问题出在你的application.properties上
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.url=jdbc:mysql://127.0.0.1:3306/mydb?useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC
spring.datasource.username=root
spring.datasource.password=123456
spring.datasource.name 是不可以的,它指的是datasource的名字
spring.datasource.data-username 这个也不对啊,什么DML,不是用户名
spring.datasource.username 才对啊,用于登录数据库的用户名
password也是一样的,所以在写代码的时候要注意啊,鬼知道这个问题我找了多久,😔