①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端口
本文介绍了如何在MySQL中为root用户添加全局权限,并通过修改user表来调整权限配置。此外,还提到了服务器安全组规则及防火墙设置中关于开放MySQL 3306端口的方法。

1239

被折叠的 条评论
为什么被折叠?



