use mysql;
select user,host from user;
update user set host = '%' where user = 'root'

host=%含义

%是通配符,host标识是设置允许访问的ip地址

例如:

  * host=localhost:只允许本机访问

  * host=169.254.18.%:只允许169.254.18.网段的可以访问

  * host=%:允许所有ip地址访问