init datasource error, url: jdbc:mysql://localhost:3306/test?characterEncoding=utf8&allowPublicKeyRetrieval=true&serverTimezone=UTC
java.sql.SQLException: Access denied for user [email protected] (using password: YES)
给小弟讲数据库连接池的时候,出现了这错误
查了半天也没查出来
这块代码就几条不会出现错误,应该是配置文件出现了错误
查看他的配置如下
user=root
password=12345678#driver=com.mysql.cj.jdbc.Driver
driver=com.mysql.jdbc.Driver
url=jdbc:mysql://localhost:3306/test?characterEncoding=utf8&allowPublicKeyRetrieval=true&serverTimezone=UTC
原来是第一条就出现了错误,username简写为user。无语??
做个笔记给新人,刚学时不要图省事写简写,将username写为user,将password写为pw。
不要粘贴上面的代码哦??
原文:https://www.cnblogs.com/ycdy/p/12771635.html