> mysql -V
> mysql -u root -p
> Enter password: ******
>
mysql> select version();
> net stop mysql
> mysqld --console --skip-grant-tables --shared-memory
注意:重新打开一个 cmd 窗口(原窗口不要关闭)
1、登录 mysql
> mysql -u root -p
> -- 不输入密码,直接登录(回车键)
>
> use mysql
2、将 root 的身份认证置为 空
> update user set authentication_string = '' where user = 'root';
3、重置 root 密码
> alter user 'loot'@'localhost' identified by '新密码';
若执行出现如下报错:
ERROR 1290 (HY000): The MySQL server is running with the–skip-grant-tables option so it cannot execute this statement
?
执行下列命令:
flush privileges