Mysql> grant all privileges on test.* to ' ybb ' @ ' percent ' 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 [email protected]% |+--- ------------------------------------------------------------------------------------------------+| GRANT USAGE on * * to ' ybb ' @ '% ' Identified by PASSWORD ' *c85ee1eaa8e69c43ce790c4cffcf1ed2f88039eb ' | | GRANT all privileges the ' test '. * to ' ybb ' @ '% ' |+--------------------- ------------------------------------------------------------------------------+2 rows in Set (0.00 sec) mysql> Revoke insert on test.* from [email protected] '% '; Query OK, 0 rows Affected (0.00 sec) mysql> Show grants for ybb;+----------------------------------------------------- --------------------------------------------------------------------------------------------------------------- ------------------------------------------------+| Grants for [email protected]% |+------------ --------------------------------------------------------------------------------------------------------------- -----------------------------------------------------------------------------------------+| GRANT USAGE on * * to ' ybb ' @ '% ' identified by PASSWORD ' *c85ee1eaa8e69c43ce790c4cffcf1ed2f88039eb ' || GRANT SELECT, UPDATE, DELETE, create, DROP, REFERENCES, INDEX, ALTER, CREATE temporary TABLES, LOCK TABLES, EXECUTE, creat E view, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER on ' test '. * to ' ybb ' @ '% ' |+------------------------------ --------------------------------------------------------------------------------------------------------------- -----------------------------------------------------------------------+2 rows in Set (0.00 sec) mysql>
From the above you can see that all privileges contains the following permissions:
Select, insert, UPDATE, delete, create, drop, references, index, ALTER, create temporary tables, lock tables, execute, CRE Ate view, show view, create routine, alter routine, event, trigger
What permissions are included in all privileges in MySQL