第一种Access denied for user ‘root’@‘localhost’ (using password: NO)
可以查看是不是自己yml中的配置有问题。
spring:
datasource:
#注意这两个是错误
data-username: xxx
data-password: xxx
#下面这俩才是正确的配置,没有前面data的前缀
username: xxx
password: xxx
第二种Access denied for user ‘root’@‘localhost’ (using password: YES)
查了很多人的博客,都说是进数据库对当前远程用户授权啊、配置里的密码要变为字符串啊什么的,结果试完一遍都没有效果,最终发现还是时区的问题。
直接在url后面加上serverTimezone=GMT%2B8结果问题就解决了。