4 权限和用户管理
权限和用户管理
CREATE USER DJ IDENTIFIED BY '123456'; -- 创建用户
SET PASSWORD FOR DJ = PASSWORD('123');-- 修改密码
RENAME USER DJ TO @%;-- 重命名
SHOW GRANTS FOR DH; -- 查看权限
SHOW GRANTS FOR root@localhost; -- 查看权限
GRANT ALL PRIVILEGES ON *.* TO DH; -- 授权
REVOKE ALL PRIVILEGES ON *.* TO DH; -- 撤销
DROP USER DH; -- 删除用户