加入收藏 | 设为首页 | 会员中心 | 我要投稿 洛阳站长网 (https://www.0379zz.com/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > MySql教程 > 正文

MySQL限制IP网段范围从远程访问的方法

发布时间:2022-04-04 11:51:53 所属栏目:MySql教程 来源:互联网
导读:mysqlgrant select,insert,update,create on test.* to test@192.168.8.% identified by 123456; mysqlgrant select,insert,update,create on test.* to test@192.168.9.% identified by 123456; mysqlgrant select,insert,update,create on test.* to tes
        mysql>grant select,insert,update,create on test.* to test@'192.168.8.%' identified by '123456';
 
        mysql>grant select,insert,update,create on test.* to test@'192.168.9.%' identified by '123456';
 
        mysql>grant select,insert,update,create on test.* to test@'192.168.20.%' identified by '123456';
 
        上面的语句表示将test数据库的所有权限授权给test这个用户,只允许test用户在192.168.8/9/20这三个网段的IP范围进行远程登陆,并设置test用户的密码为123456
 
        刷新权限表使其设置生效:
        mysql> flush privileges;

(编辑:洛阳站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!