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

posted @ 2017-03-01 16:46  howhy  阅读(142)  评论(0编辑  收藏  举报