CREATE USER 'li'@'localhost' IDENTIFIED by '123';
grant select on scott.* TO 'li'@'localhost';
REVOKE UPDATE on scott.dept from 'li'@'localhost';
UPDATE dept set sal=2000 where ename='scott';
grant SELECT,UPDATE,INSERT,DELETE on scott.dept to 'li'@'localhost';
REVOKE select on scott.emp from 'li'@'localhost';
CREATE user 'zhang'@'localhost' IDENTIFIED by '456';
grant select,insert on scott.dept to 'zhang'@'localhost' with grant option;
create user 'wan'@'localhost'identified by '789';
select * from dept;
insert into dept values(70,'houqin','shenyang');
GRANT select,insert on scott.dept to 'wan'@'localhost';
select * from dept;
insert into dept values(80,'dddd','dalian');
REVOKE grant option on scott.dept from 'zhang'@'localhost';
grant select on scott.* to 'wan'@'localhost';
REVOKE select on scott.dept from 'wan'@'localhost';
show grants for 'wan'@'localhost';
GRANT select(ename) on scott.emp to 'wan'@'localhost';
REVOKE all on scott.* from 'wan'@'localhost';
SELECT ename from emp;
select * from emp;