|
MySQL 权限管理简单篇
创建用户
CREATE USER 用户名 IDENTIFIED BY 密码
示例:
CREATE USER kaigexuetang IDENTIFIED BY ‘kaige123.com’;
删除用户 注意删除用户需要取消权限
DROP USER []
示例:
DROP USER kaigexuetang;
赋予用户权限
GRANT [功能] ON 库.表 TO 用户
示例:
GRANT SELECT ON kaige.user TO kaigexuetang;
收回权限
REVOKE [功能] ON 库.表 FROM 用户
示例:
REVOKE SELECT ON kaige.user FROM kaigexuetang;
修改用户密码
SET PASSWORD FOR kaigexuetang=PASSWORD('kaige123.com');
显示所有权限
SHOW GRANTS FOR kaigexuetang; |
|