Steaunk
2020-09-07 11:32
采纳率: 100%
浏览 100

mysql 8.0 修改 root 密码

alter user 'root'@'localhost'IDENTIFIED BY 'password';

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY password';

ERROR 1396 (HY000): Operation ALTER USER failed for 'root'@'localhost'

想要修改 root 密码,一直跳出这个问题是啥意思?

| root | localhost | mysql_native_password |

  • 好问题 提建议
  • 收藏

1条回答 默认 最新

  • qq_31366199 2020-09-07 14:58
    已采纳

    -- 修改密码:
    -- 1,先置空
    update user set authentication_string='' where user = 'root';
    -- 2,再修改
    ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '密码'

    已采纳该答案
    评论
    解决 无用
    打赏 举报

相关推荐 更多相似问题