这是由于mysql无法映射::这个本地地址造成,USER表里面只有root@localhost,新增一个*所有地址可以登录的root账户
在my.ini中编辑增加一行添加如下内容:
skip-grant-tables #用来跳过密码验证的过程
重启服务后mysql -uroot -p直接回车两次
use mysql;
update mysql.user set authentication_string=PASSWORD(‘Lid4EbXkFPa’) where user=’root’;
flush privileges;
grant all privileges on *.* to root@’%’ identified by ‘Lid4EbXkFPa’ with grant option;
执行这里会有以下报错, 不用理会它,继续执行
ERROR 1290 (HY000): The MySQL server is running with the –skip-grant-tables option so it cannot execute this statement
flush privileges;
grant all privileges on *.* to root@’%’ identified by ‘Lid4EbXkFPa’ with grant option;
flush privileges;