1.关闭mysql服务。编辑bin/my.ini,在[mysqld]下加上skip-grant-tables:
[mysqld]
port= 3306
...
skip-grant-tables
2.启动mysql服务。用PASSWORD函数进行密码更新:
update user set password=PASSWORD("new-password") where user="root";
3.将步骤1中加的skip-grant-tables注释掉.重启mysql服务。OK。
1.关闭mysql服务。编辑bin/my.ini,在[mysqld]下加上skip-grant-tables:
[mysqld]
port= 3306
...
skip-grant-tables
2.启动mysql服务。用PASSWORD函数进行密码更新:
update user set password=PASSWORD("new-password") where user="root";
3.将步骤1中加的skip-grant-tables注释掉.重启mysql服务。OK。