首頁 > mysql教程 閱讀:0更新時間:2020-12-10 17:19:34

mysql中all privileges包含哪些權限

mysql> grant all privileges on test.* to 'ybb'@'%' identified by 'ybb';
Query OK, 0 rows affected (0.07 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql> select host,user,password from mysql.user where user='ybb' and host='%';
+-----------+---------+-------------------------------------------+
| host      | user    | password                                  |
+-----------+---------+-------------------------------------------+
| %         | ybb      | *C85EE1EAA8E69C43CE790C4CFFCF1ED2F88039EB |
+-----------+---------+-------------------------------------------+
1 rows in set (0.00 sec)

mysql> show grants for ybb;
+---------------------------------------------------------------------------------------------------+
| Grants for ybb@%                                                                                   |
+---------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'ybb'@'%' IDENTIFIED BY PASSWORD '*C85EE1EAA8E69C43CE790C4CFFCF1ED2F88039EB' |
| GRANT ALL PRIVILEGES ON `test`.* TO 'ybb'@'%'                                                      |
+---------------------------------------------------------------------------------------------------+
2 rows in set (0.00 sec)

mysql> revoke insert on test.* from ybb@'%';
Query OK, 0 rows affected (0.00 sec)

mysql> show grants for ybb;
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Grants for ybb@%                                                                                                                                                                                                    |
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'ybb'@'%' IDENTIFIED BY PASSWORD '*C85EE1EAA8E69C43CE790C4CFFCF1ED2F88039EB'                                                                                                                  |
| 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'@'%' |
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
2 rows in set (0.00 sec)

mysql>

  

從上可以看出all privileges包含以下權限

 select,
 insert,
 update,
 delete,
 create,
 drop,
 references,
 index,
 alter,
 create temporary tables,
 lock tables,
 execute,
 create view,
 show view,
 create routine,
 alter routine,
 event,
 trigger

beylze編程學院,一個分享編程知識和seo優化知識的網站。跟著beylze一起學習,每天都有進步。

通俗易懂,深入淺出,一篇文章只講一個知識點。

文章不深奧,不需要鉆研,在公交、在地鐵、在廁所都可以閱讀,隨時隨地漲姿勢。

文章不涉及代碼,不燒腦細胞,人人都可以學習。

當你決定關注beylze(公眾號:beylze),你已然超越了90%的其他從業者!

相關文章

国产亚洲欧美日韩