一.在jdbc_info.properties的命名出错
driver=com.mysql.cj.jdbc.Driver
url=jdbc:mysql://localhost:3306/configuredb?useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC
password=123456
username=root
修改后:
jdbc.driver=com.mysql.cj.jdbc.Driver
jdbc.url=jdbc:mysql://localhost:3306/configuredb?useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC
jdbc.password=123456
jdbc.username=root
原因:
username在windows下默认取值为电脑的账号,一般电脑账号为administrator,如果你的电脑账号是自己设置的,那就为设置的账号。
第二种方案:为电脑账号赋权限
在doc命令窗口进入到MySQL的bin目录下,输入:
GRANT ALL PRIVILEGES ON *.* TO 'xxx'@'%' IDENTIFIED BY '123456' WITH GRANT OPTION;
#xxx指根据你的报错信息的账号名,如上图,就输入San,‘123456’指密码
flush privileges
另外一种报错的可能
username=root在命名时有空格,用鼠标点击确认一下即可