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;
原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/279457.html