You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.6 KiB

  1. select priv into @root_priv from mysql.global_priv where user='root' and host='localhost';
  2. grant select on *.* to current_role;
  3. ERROR OP000: Invalid role specification `NONE`
  4. revoke select on *.* from current_role;
  5. ERROR OP000: Invalid role specification `NONE`
  6. revoke all, grant option from current_role;
  7. ERROR OP000: Invalid role specification `NONE`
  8. create role r1;
  9. grant insert on test.* to r1;
  10. grant r1 to current_user;
  11. set role r1;
  12. select current_role();
  13. current_role()
  14. r1
  15. grant select on *.* to current_role;
  16. show grants for current_role;
  17. Grants for r1
  18. GRANT SELECT ON *.* TO `r1`
  19. GRANT INSERT ON `test`.* TO `r1`
  20. revoke insert on test.* from current_role;
  21. show grants for current_role;
  22. Grants for r1
  23. GRANT SELECT ON *.* TO `r1`
  24. revoke all, grant option from current_role;
  25. show grants for current_role;
  26. Grants for r1
  27. GRANT USAGE ON *.* TO `r1`
  28. set password=password('foobar');
  29. show grants;
  30. Grants for root@localhost
  31. GRANT `r1` TO `root`@`localhost` WITH ADMIN OPTION
  32. GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` IDENTIFIED BY PASSWORD '*9B500343BC52E2911172EB52AE5CF4847604C6E5' WITH GRANT OPTION
  33. GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
  34. GRANT USAGE ON *.* TO `r1`
  35. grant r1 to current_user() identified by 'barfoo';
  36. show grants;
  37. Grants for root@localhost
  38. GRANT `r1` TO `root`@`localhost` WITH ADMIN OPTION
  39. GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` IDENTIFIED BY PASSWORD '*343915A8181B5728EADBDC73E1F7E6B0C3998483' WITH GRANT OPTION
  40. GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
  41. GRANT USAGE ON *.* TO `r1`
  42. set password='';
  43. drop role r1;
  44. update mysql.global_priv set priv=@root_priv where user='root' and host='localhost';