运行以下命令
mysql -uroot -proot(填写自己的用户名和密码)
update user set host = '%' where user = 'root' where host='localhost';
flush privileges;
select host, user from user;
再次连接即可
运行以下命令
mysql -uroot -proot(填写自己的用户名和密码)
update user set host = '%' where user = 'root' where host='localhost';
flush privileges;
select host, user from user;
再次连接即可