mysql的root密码忘了

忘记密码:
https://www.cnblogs.com/ryanzheng/p/9348723.html
my.cnf
的[mysqld]下加:
skip-grant-tables
重启

mysql -uroot
update user set authentication_string = NULL where user = 'root';
退出,删除skip-grant-tables,重启
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'web99~';

原文地址:https://www.cnblogs.com/hongfeng2019/p/11792311.html