Mysql配置白名单
程序员文章站
2022-05-18 20:45:53
...
1.登录mysql并进入命令行操作
mysql -u root -p
2.如果赋予该ip下该用户所有权限
grant all on *.* to 'username'@'ip' identified by 'password' with grant option;
例如:
grant all on *.* to 'root'@'192.168.1.111' identified by '[email protected]' with grant option;
如果是赋予部分权限,可以如下:
grant select,create,drop,update,alter on *.* to 'username'@'ip' identified by 'password' with grant option;
3.删除白名单用户的权限
DELETE FROM user WHERE User='username' and Host='ip';
这步慎做,删错了就登不上mysql了
4.刷新权限
FLUSH PRIVILEGES;
上一篇: 替换禁用语(指定关键字)的过滤器(StopWordsFilter)
下一篇: vue的过滤器