JBOSS 点滴

丰丰的博客

mysql5.x忘记密码

参考:https://blog.csdn.net/qq_34102150/article/details/126120056


1、停止MySQL服务,输入 net stop mysql 停止服务。
2、切换到MySQL的bin文件下,
    mysql5.x:  mysqld --console --skip-grant-tables --shared-memory

mysqld --console --skip-grant-tables --shared-memory
3、输入mysql -uroot -p回车,不用输入密码,直接按回车跳过,
    输入:  use mysql 
    输入:  update user set password=PASSWORD('123456') where USER='root';
    或者:   GRANT ALL PRIVILEGES ON *.* TO 'root'@'%'IDENTIFIED BY '123456' WITH GRANT OPTION;
    输入:  FLUSH PRIVILEGES;
4、重启服务

posted on 2024-02-17 15:09 半导体 阅读(16) 评论(0)  编辑  收藏


只有注册用户登录后才能发表评论。


网站导航: