Mysql 8.0 密码修改
Mysql 8.0 密码修改
-
停止mysql服务
net stop mysql -
跳过权限认证启动mysql服务
mysqld --console --skip-grant-tables --shared-memory -
打开一个新的cmd窗口,启动mysql服务
net start mysql -
输入密码直接空格键跳过
mysql -u root -p -
使用msyql库
use mysql; -
将密码置空
update user set authentication_string='' where user='root'; -
关闭mysql服务(直接关闭窗口即可)
-
重新开启mysql服务,可以无密码登陆了
-
修改密码
alter user'root'@'localhost' identified by '123456'; -
刷新权限认证
flush privileges; -
exit

浙公网安备 33010602011771号