DCL数据控制语言
一、创建用户
create user 'hellokitty'@'localhost' identified by '123123123';
二、给用户授权
1.授予tb_dept查询权
grant select on hrs.tb_dept to 'hellokitty'@'localhost';
2.授予tb_dept插入权
grant insert on hrs.tb_dept to 'hellokitty'@'localhost';
3.授予hrs下所有表的权限
grant insert, delete, update, select on hrs.* to 'hellokitty'@'localhost';
4.授予所有数据库下所有表的权限
grant insert, delete, update, select on *.* to 'hellokitty'@'localhost';
5.授予所有数据库下所有表的所有操作权限
grant all privileges on *.* to 'hellokitty'@'localhost';
6.授予所有数据库下所有表的所有操作权限同时允许讲已获得的权限授予他人
grant all privileges on *.* to 'hellokitty'@'localhost' with grant option;
三、召回权限
revoke all privileges on *.* from 'hellokitty'@'localhost';
四、修改用户
1.修改用户密码
alter user 'hellokitty'@'localhost' identified by '321321321'
2.删除用户
drop user 'hellokitty'@'localhost';