root登录
切换到mysql数据库
use mysql;
查看user表
select user,host from user;
增加ip
grant all privileges on *.* to root@"xxx.xxx.xxx.xxx" identified by "密码";
或(%表示允许所有ip)
grant all privileges on *.* to root@"%" identified by "密码";
flush privileges;
好记性不如烂笔头~~