标签:
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;
标签: