##切换数据库
use mysql;
##查看user及Host信息
select User,Host from user;
#添加允许远程连接的用户及地址,例如只允许192.168.130-139段的IP访问
grant all privileges on *.* to root@"192.168.1.13%" identified by ‘tfedu6188‘ with grant option;
##更新之前允许为全部的连接用户
UPDATE `user` SET `Host` = ‘192.168.1.10%‘ where `Host` = ‘%‘;
##刷新规则
flush privileges;
##退出
exit