• 前言:

    就在这两天,探索了一下SpringMvc + Mybatis,反复读反复改终于在一次次接近答案的最后成功了。啧啧,你可以想象我以前是做springboot的。但基本模式不能忘!

  • 问题描述:

    通过SpringMvc+Mybatis在MySql连接中 ,报出了Access denied for user ‘xxx’@‘localhost’

  • 问题原因:

    这个原因有些网上人说是数据库访问权限问题,但是又有些人说是这个配置文件中没有正确获得值的问题。所以就做一个解决方法汇总吧。

  • 解决方法:

    第一种:在你的xxxxxx.properties数据库信息文件中,在名字前加上jdbc.Mysql错误(一):Access denied for user ''[email protected]'localhost' (using password: YES)错误解决方法

第二种:
依次执行mysql>use mysql;
mysql>select host ,user from user;
查看结果是不是root用户仅允许本地 localhost 登录,是的话接着执行,就要修改它的host为%,表示任意IP地址都可以登录。
mysql> update user set host =’%’ where user=‘root’;Mysql错误(一):Access denied for user ''[email protected]'localhost' (using password: YES)错误解决方法
最后:
mysql> flushprivileges把缓存flush掉

相关文章:

  • 2022-12-23
  • 2021-06-12
  • 2022-12-23
  • 2021-03-27
  • 2022-12-23
  • 2021-11-08
  • 2021-12-25
  • 2021-06-15
猜你喜欢
  • 2021-07-09
  • 2021-04-09
  • 2021-09-08
  • 2021-07-22
  • 2021-08-26
  • 2022-12-23
  • 2021-10-23
相关资源
相似解决方案