mysql忘记密码修改

mysql忘记密码修改

-- 忘记密码,my.cnf配置如下,再去不用密码登录mysql,然后修改密码
-- skip-grant-tables

use mysql
update user set password=password('1qaz2WSX!@') where user='root';
flush privileges;

-- 5.7、8.0后改密码
update user set authentication_string=password("DElu_2023911#") where user='root'; 

alter user 'root'@'%' identified with mysql_native_password by '1qaz2WSX-=';
flush privileges;

posted @ 2021-07-11 13:16  幸运刘  阅读(28)  评论(0)    收藏  举报