①mysql中user表添加一行root为%、
use mysql;
insert into user values('%', 'root', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', '', '', '', '', '0', '0', '0', '0', 'mysql_native_password', '*9DD87DBB130018FC7FB9B64017DE541379884BD5', 'N', '2017-10-20 08:51:13', NULL, 'N');
select * from mysql.user;
grant all privileges on *.* to 'root'@'%' identified by 'huiyuanlianghua' with grant option;
flush privileges;
②grant赋值权限 也可以直接修改user表中的权限
③服务器安全组规则中,要开放mysql的3306端口,防火墙中也要新建入规则过滤3306端口