当前位置:   article > 正文

linux下修改mysql密码: ERROR 1396 (HY000): Operation ALTER USER failed for ‘root‘@‘localhost‘

error 1396 (hy000): operation alter user failed for 'root'@'localhost

 

1. 问题重现
  1. mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'xxxxx';
  2. ERROR 1396 (HY000): Operation ALTER USER failed for 'root'@'localhost'

 

 

2. 解决方法
  1. use mysql;
  2. select user,host from user where user='root';

  1. 发现 host 列的值是 ‘%’,因此将修改密码语句改为:
  2. ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'xxxxxx';
  3. flush privileges;

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Cpp五条/article/detail/535662
推荐阅读
相关标签
  

闽ICP备14008679号