1、删除解压目录下的data里面所有文件,运行cmd到当前目录
初始化(记住临时密码)
mysqld --initialize --user=mysql --console
安装
mysqld -install
mysqld Install
启动服务
net start MySQL
登录输入刚刚的初始化的密码
mysql -u root -p
设置新密码为123456
mysql>ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '123456'
退出
mysql>exit
此时重新进入就是新密码了
Client does not support authentication protocol requested by server解决方案
记得输入“;”结束语句
USE mysql;
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '123456';
FLUSH PRIVILEGES;