MySQL 用户权限管理

2022-04-25 18:23:13 浏览数 (1)

删除权限

代码语言:javascript复制
REVOKE ALL PRIVILEGES ON `8oh`.* FROM '8oh'@'%'; GRANT USAGE ON `8oh`.* TO '8oh'@'%';

除了Grant权限赋予:

代码语言:javascript复制
REVOKE ALL PRIVILEGES ON `8oh`.* FROM '8oh'@'%'; GRANT ALL PRIVILEGES ON `8oh`.* TO '8oh'@'%';

移除Grant权限

代码语言:javascript复制
REVOKE ALL PRIVILEGES ON `8oh`.* FROM '8oh'@'%'; REVOKE GRANT OPTION ON `8oh`.* FROM '8oh'@'%'; GRANT ALL PRIVILEGES ON `8oh`.* TO '8oh'@'%';

赋予只读权限

代码语言:javascript复制
GRANT SELECT, DELETE, SHOW VIEW ON `8oh`.* TO '8oh'@'%';

其实就是移除了所有权限然后再根据需求重新赋予权限

0 人点赞