当前位置:   article > 正文

mysql中all privileges包含哪些权限

all privileges
  1. mysql> grant all privileges on test.* to 'ybb'@'%' identified by 'ybb';
  2. Query OK, 0 rows affected (0.07 sec)
  3. mysql> flush privileges;
  4. Query OK, 0 rows affected (0.00 sec)
  5. mysql> select host,user,password from mysql.user where user='ybb' and host='%';
  6. +-----------+---------+-------------------------------------------+
  7. | host | user | password |
  8. +-----------+---------+-------------------------------------------+
  9. | % | ybb | *C85EE1EAA8E69C43CE790C4CFFCF1ED2F88039EB |
  10. +-----------+---------+-------------------------------------------+
  11. 1 rows in set (0.00 sec)
  12. mysql> show grants for ybb;
  13. +---------------------------------------------------------------------------------------------------+
  14. | Grants for ybb@% |
  15. +---------------------------------------------------------------------------------------------------+
  16. | GRANT USAGE ON *.* TO 'ybb'@'%' IDENTIFIED BY PASSWORD '*C85EE1EAA8E69C43CE790C4CFFCF1ED2F88039EB' |
  17. | GRANT ALL PRIVILEGES ON `test`.* TO 'ybb'@'%' |
  18. +---------------------------------------------------------------------------------------------------+
  19. 2 rows in set (0.00 sec)
  20. mysql> revoke insert on test.* from ybb@'%';
  21. Query OK, 0 rows affected (0.00 sec)
  22. mysql> show grants for ybb;
  23. +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  24. | Grants for ybb@% |
  25. +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  26. | GRANT USAGE ON *.* TO 'ybb'@'%' IDENTIFIED BY PASSWORD '*C85EE1EAA8E69C43CE790C4CFFCF1ED2F88039EB' |
  27. | GRANT SELECT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER ON `test`.* TO 'ybb'@'%' |
  28. +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  29. 2 rows in set (0.00 sec)
  30. mysql>

  

从上可以看出all privileges包含以下权限:

  1. select,
  2. insert,
  3. update,
  4. delete,
  5. create,
  6. drop,
  7. references,
  8. index,
  9. alter,
  10. create temporary tables,
  11. lock tables,
  12. execute,
  13. create view,
  14. show view,
  15. create routine,
  16. alter routine,
  17. event,
  18. trigger

  

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/煮酒与君饮/article/detail/744771
推荐阅读
相关标签
  

闽ICP备14008679号