Mysql5.7.14 linux版密码忘记完美解决办法
在/etc/my.conf文件中[mysqld]下面最后增加一行:skip-grant-tables
记住是[mysqld]下最后,不要增加到[mysqld_safe]下面
保存之后,重启Mysql,在linux命令行直接执行:mysql回车
OK
修改密码:
updatemysql.usersetpassword=password('root')whereuser='root'
结果报错:
mysql>selecthost,user,passwordfromuser; ERROR1054(42S22):Unknowncolumn'password'in'fieldlist' descuser;
查看字段发现没有password字段,有authentication_string字段
updatemysql.usersetauthentication_string=password('root')whereuser='root';
ok
删除/etc/my.conf文件中[mysqld]下面的skip-grant-tables
重启mysql
总结
以上所述是小编给大家介绍的Mysql5.7.14linux版密码忘记完美解决办法,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对毛票票网站的支持!