亲测有效。仅测5.6版本。
1.找到my.ini文件,在[mysqld]下加一句
skip-grant-tables
2.重启服务
net stop mysql
net start mysql
3.登录
mysql -uroot mysql
4.修改密码
mysql > update user set authentication_string = password('123456') where user = 'root' and Host = 'localhost'
5.刷新权限
mysql > flush privileges;
6.退出mysql并删除my.ini中的skip-grant-tables
7.重启mysql
net stop mysql
net start mysql
8.登录
#mysql -uroot -p
成功。
参考:
因篇幅问题不能全部显示,请点此查看更多更全内容
Copyright © 2019- efsc.cn 版权所有 赣ICP备2024042792号-1
违法及侵权请联系:TEL:199 1889 7713 E-MAIL:2724546146@qq.com
本站由北京市万商天勤律师事务所王兴未律师提供法律服务