mysql 用户维护

#创建账号 * 
CREATE USER 'basic'@'%' IDENTIFIED BY 'basic@252.';

#修改密码 * 
ALTER user 'basic'@'%' IDENTIFIED BY 'basic@252.';

# 授予用户所有库、所有表crud权限 (1*表述库;2*表示表)
grant select,update,delete,insert on *.* to 'basic'@'%';

# 所有权限(1*表述库;2*表示表)
grant all on *.* to 'basic'@'%';

# 撤销权限
REVOKE select,update,delete,insert on *.* to 'basic'@'%';
REVOKE ALL ON *.* TO 'basic'@'%';

# 刷新
FLUSH PRIVILEGES;

# 查看用户权限
SHOW GRANTS FOR 'basic'@'%' \G;

你可能感兴趣的:(mr.chenyb,数据库,mysql)