【异常】连接MySQL权限异常SQLException: Access denied for user 'root'@'192.168.xxx.xxx' (using password: YES)

IDEA程序访问Mysql,出现权限异常。
SQLException: Access denied for user 'root'@'192.168.119.1' (using password: YES)


应该是mysql中的特定库、特定表等对特定的用户、特定的ip开放。

所以可以修改一下,在mysql中执行:grant all privileges on *.* to root@'%' identified by '123456';

表示root用户可以在任何ip都可以访问任何库的任何对象,密码是123456

生产上,按实际情况而定。

原文地址:https://www.cnblogs.com/huomei/p/12103760.html