linux下mysql忘记密码
Posted 知和乎
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了linux下mysql忘记密码相关的知识,希望对你有一定的参考价值。
- 编辑/etc/my.cnf
在[mysqld]中添加
skip-grant-tables
:wq 保存退出
·······2.进入mysql
修改密码
update mysql.user set password=PASSWORD(‘新密码‘)where User=‘root‘;
ERROR 1054 (42S22): Unknown column ‘password‘ in ‘field list‘
错误的原因是 5.7版本下的mysql数据库下已经没有password这个字段了,password字段改成了authentication_string
update mysql.user set authentication_string=password(‘新密码‘) where user=‘root‘;
3、刷新权限
flush privileges;
4、quit;退出
以上是关于linux下mysql忘记密码的主要内容,如果未能解决你的问题,请参考以下文章