mysql 8+ 修改密码
忘记密码后,先置空在修改
my.cnf中添加 skip-grant-tables
启动mysql
mysql -uroot -p 登陆
update user set authentication_string = ‘’ where user = ‘root’;
//刷新
FLUSH PRIVILEGES;
注释掉my.cnf中的 skip-grant-tables
alter user ‘root’@‘localhost’ identified with mysql_native_password by ‘你的密码’;
FLUSH PRIVILEGES;