The specified database user/password combination is rejected: com.mysql.cj.exceptions.CJException:

问题描述

JAVA环境连接数据库报错,信息如下所示
The specified database user/password combination is rejected: com.mysql.cj.exceptions.CJException: Access denied for user ‘root’@‘192.168.235.1’ (using password: YES)
mark

问题解决

1、给数据库添加远程访问的权限

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123456' WITH GRANT OPTION;

FLUSH PRIVILEGES;

2、重启连接数据库访问

mark

猜你喜欢

转载自blog.csdn.net/weixin_39608791/article/details/108323651