Advertisement
Rodrigato

Untitled

Oct 14th, 2019
401
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 2.08 KB | None | 0 0
  1. create user func_1@localhost identified by 'func1';
  2. create user func_2@localhost identified by 'func2';
  3. create user func_3@localhost identified by 'func3';
  4. create user func_4@localhost identified by 'func4';
  5. create user func_5@localhost identified by 'func5';
  6.  
  7. create role 'Administrador','Desenvolvedor','Designer','Desenvolvedor estagiário', 'Revisor';
  8.  
  9. grant all on livraria_prof.* to Administrador with grant option;
  10. grant all on restaurantes.* to Administrador with grant option;
  11. grant Administrador to func_1@localhost; /*func_1 = Administrador*/
  12. set default role Administrador for func_1@localhost; /*MariaDB Sintax*/
  13.  
  14. grant alter,create,drop,trigger,show view,create view,create routine, alter routine,execute,select,insert,update,delete,execute on livraria_prof.* to Desenvolvedor;
  15. grant alter,create,drop,trigger,show view,create view,create routine, alter routine,execute,select,insert,update,delete,execute on restaurantes.* to Desenvolvedor;
  16. grant Desenvolvedor to func_2@localhost; /*Func_2 = Desenvolvedor*/
  17. set default role Desenvolvedor for func_2@localhost; /*MariaDB Sintax*/
  18.  
  19. grant alter,create,trigger,show view,create view,create routine, alter routine,execute,select,insert,update,execute on livraria_prof.* to 'Desenvolvedor estagiário';
  20. grant alter,create,trigger,show view,create view,create routine, alter routine,execute,select,insert,update,execute on restaurantes.* to 'Desenvolvedor estagiário';
  21. grant 'Desenvolvedor estagiário' to func_3@localhost; /*Func_3 = Desenvoledor estagiário*/
  22. set default role 'Desenvolvedor estagiário' for func_3@localhost; /*MariaDB Sintax*/
  23.  
  24. grant alter,create,drop,select,insert,update on livraria_prof.* to Revisor;
  25. grant alter,create,drop,select,insert,update on restaurantes.* to Revisor;
  26. grant Revisor to func_4@localhost; /*Func_4 = Revisor*/
  27. set default role Revisor for func_4@localhost; /*MariaDB Sintax*/
  28.  
  29. grant select on livraria_prof.* to Designer;
  30. grant select on restaurantes.* to Designer;
  31. grant Designer to func_5@localhost; /*Func_5 = Revisor*/
  32. set default role Designer for func_5@localhost; /*MariaDB Sintax*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement