1、停止mysql服务
net stop mysql
2、修改mysql目录下的my.ini文件,跳过mysql的登录验证
[mysqld]
skip-grant-tables
3、启动mysql服务
net start mysql
4、命令窗口登录mysql(此时不用密码也能登录),新建用户并授权
update mysql.user set authentication_string=password('123456') where user='root' and Host = 'localhost';
flush privileges;
grant all privileges on *.* to root@'localhost' identified by "123456";