mysql简单的用户管理语句

-- 增加一个用户
CREATE USER zhangsan IDENTIFIED BY '123456';


-- 设置密码
SET PASSWORD FOR 'zhangsan'=PASSWORD('123456')


-- 授予权限
GRANT ALL ON *.* TO zhangsan
-- 查看语句
SHOW GRANTS FOR 'root'@'localhost'

-- 查看当前用户权限
SHOW GRANTS FOR CURRENT_USER

-- 撤销权限
REVOKE ALL ON *.* FROM zhangsan

-- 删除用户
DROP USER zhangsan

你可能感兴趣的:(mysql基础)