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
生產上,按實際情況而定。