MySQL忘记密码怎么办,MySQL如何重置密码
首先打开cmd命令行,执行net stop mysql,把mysql服务先关掉
接着执行如下图所示的mysqld --skip-grant-tables命令
然后直接输入mysql进入编辑
接着输入show databases命令,并且选中mysql数据库
然后输入show tables命令,找到user表
最后执行update语句修改root密码即可
update user set password=password(‘123456’) where user=‘root’ and host=‘localhost’;即可完成对mysql密码的修改,然后输入select user,host,password from user查看修改后的密码
5.7版本已经不再使用password来作为密码的字段了 而改成了authentication_string
mysql> update user set authentication_string=password(‘123‘) where user=‘root‘ and host=‘localhost’
转载:https://blog.csdn.net/kaifaxiaoliu/article/details/79774265