数据库
首页 > 数据库> > Mysql-强制改密

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;

标签:mysql,privileges,Mysql,flush,改密,MySQL,强制,localhost
来源: https://www.cnblogs.com/a999/p/16560098.html