mysql 8-windows重置密码
net stop mysql # 也可能mysql80 看服务里面的名字
mysqld --datadir="data所在目录,不需要指定的话直接不写" -console --skip-grant-tables --shared-memory
mysql -uroot #开一个新窗口进行
update mysql.user set authentication_string=null where User='root';#重置密码
flush privileges;
exit;
mysql -uroot #再开一个窗口进行密码更改
alter user 'root'@'localhost' identified by '123456';
然后完成了-验证
mysql -uroot -p