mysql8忘记密码
- 停止正在运行的mysql服务
net stop mysql
- 控制台跳过授权启动mysql服务
mysqld --console --skip-grant-tables --shared-memory
- 登录mysql -uroot -p,不需要输入密码,修改密码为空
UPDATE mysql.user SET authentication_string='' WHERE user='root';
- 退出登录,关闭mysql服务,重新正常启动mysql服务后修改密码
net stop mysql
mysqld --console --skip-grant-tables --shared-memory
UPDATE mysql.user SET authentication_string='' WHERE user='root';