美文网首页
MySQL8忘记root密码处理步骤

MySQL8忘记root密码处理步骤

作者: Quick_5413 | 来源:发表于2023-04-09 17:16 被阅读0次

    1、systemctl set-environment MYSQLD_OPTS="--skip-grant-tables"
    2、systemctl restart mysqld
    3、输入mysql后可直接登录
    4、mysql> alter user 'root'@'localhost' identified by 'xxxxxxx';
    mysql>flush privileges;
    mysql> alter user 'root'@'localhost' identified by 'xxxxx';
    退出登录
    5、恢复密码登录
    systemctl set-environment MYSQLD_OPTS=""
    systemctl restart mysqld
    或者
    reboot
    systemctl show-environment 查看MYSQLD_OPTS
    分享:

    相关文章

      网友评论

          本文标题:MySQL8忘记root密码处理步骤

          本文链接:https://www.haomeiwen.com/subject/roibddtx.html