【异常】连接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

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

猜你喜欢

转载自www.cnblogs.com/huomei/p/12103760.html