一 找到数据库my.ini文件,添加skip-grant-tables,设置无密码登录
二、重启数据库(net stop mysql net start mysql),登录(MySQL -uroot -p -P3360 -hlocalhost),查看本地所有数据库(show databases),选择一个数 据库(use mysql),执行update user set authentication_string=password ("123456") where user="root";密码设置成功。删除my.ini中的skip-grant-tables ,重启数据库,成功