美文网首页
账户管理

账户管理

作者: AAnna珠 | 来源:发表于2019-03-28 11:29 被阅读0次

    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;

    相关文章

      网友评论

          本文标题:账户管理

          本文链接:https://www.haomeiwen.com/subject/eeivvqtx.html