我使用的是mysql8:
Caused by: java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)
配置:
# 数据源配置
spring:
datasource:
type: com.alibaba.druid.pool.DruidDataSource
driverClassName: com.mysql.cj.jdbc.Driver
druid:
# 主库数据源
master:
url: jdbc:mysql://localhost:3306/ruoyi?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root
password: 000000
先声明,我的密码是对的,而且授过权
因为我的是数字,导致连不上,
需要把密码写成:'000000'
现在使用 ‘’,就能连上去了。
参考链接:https://blog.csdn.net/sinat_39572070/article/details/89708906