Mysql-强制改密

MySQL V8.0.22

[mysqld]

# 跳过登录验证
skip-grant-tables
use mysql;

update user set authentication_string = '' where User = 'root' and Host = 'localhost';

flush privileges;

-- 取消跳过登录验证,再进MySQL正常改密

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '123456';

flush privileges;
posted @ 2022-08-07 22:22  生生灯火半杯月  阅读(105)  评论(0)    收藏  举报