Granting mysql access rights to all machines on subnet

喜欢而已 提交于 2019-12-04 14:50:58

You can do it like this:

GRANT ALL PRIVILEGES ON mydb TO 'username'@'192.168.1.0/255.255.255.0';

change subnet and IP accordingly

You can also use wildcards, rather than a masks.

You can specify wildcards in the host name. For example, user_name@'%.example.com' applies to user_name for any host in the example.com domain, and user_name@'192.168.1.%' applies to user_name for any host in the 192.168.1 class C subnet.

See the Account Names and Passwords section of the in the GRANT docs.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!