mysql root密码忘记最快方法

在my.cnf [mysqld]栏添加 skip-grant-tables

然后重启/etc/init.d/mysqld restart

mysql

##select password('新密码')

update mysql.user set password=password('新密码') where user='root' and host='localhost';

注释到my.cnf中的skip-grant-tables重启mysql

原文地址:https://www.cnblogs.com/howhy/p/6485014.html