换了电脑后,导入原来的javaWeb项目,运行项目出现以下提示:
java.sql.SQLException: Access denied for user ‘root’@’localhost’ (using password YES)
分析:
1.用户名或者密码或者驱动没有写好—–>检查配置文件修改
2.权限问题
我的情况属于2
我几天按照网上各种办法都试过修改权限,有的简单有的复杂,仍然不成功…….在我快要放弃的时候看到有位大哥的方法,仅有一命令,我试了试竟然成功了!现在分享给各位小伙伴:
首先进入mysql数据库,然后输入:
grant all privileges on . to [email protected]”%” identified by “.”;
如下图所示:
完美解决java.sql.SQLException: Access denied for user 'root'@'localhost' (using password YES)
然后启动项目,直接起飞:
完美解决java.sql.SQLException: Access denied for user 'root'@'localhost' (using password YES)

相关文章:

  • 2022-12-23
  • 2021-09-14
  • 2022-12-23
  • 2022-12-23
  • 2021-09-11
  • 2021-07-03
猜你喜欢
  • 2021-07-22
  • 2021-07-31
  • 2021-05-06
  • 2021-08-11
  • 2021-12-05
  • 2021-12-28
相关资源
相似解决方案