1、先在mysql.ini中增加2行配置
[mysqld]
skip-name-resolve
skip-grant-tables
2、重启mysql服务
3、mysql/bin 目录下输入cmd打开命令行 执行mysql -u root -p,提示输入密码,直接回车
4、命令行输入下面代码修改密码
grant all privileges on . to root@'localhost' identified by '492557989';
5、会提示已配置跳过验证;
ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement
6、刷新权限权限重新修改密码即可。
flush privileges;
查询密码,查询结果是加密的!
show grants for username@localhost;
发表评论