linux下mysql忘记密码

  1. 编辑/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;退出

posted @ 2020-03-25 10:02  ¥%--1001  阅读(132)  评论(0)    收藏  举报