MySQL permissions are divided into global permissions, library permissions, table permissions, corresponding to the MySQL library inside the user table, DB table, Tables_priv table.
Grant all privileges on *. *: Operation Mysql.user Table
Grant all privileges on db.*: Operation mysql.db Table
Grant all privileges on db.table: Operation Mysql.tables_priv Table
These three kinds of operations correspond to different tables, do not affect each other, give a user a large granularity of permissions, and can not recover the small granularity of permissions.
Examples are as follows:
[Email protected]:mysql3306.sock 14:02: [test]>grant all privileges on * * to [email protected] ' 127.0.0.1 ';
Query OK, 0 rows Affected (0.00 sec)
[Email protected]:mysql3306.sock 14:03: [test]>revoke Update on test.* from [email protected] ' 127.0.0.1 ';
ERROR 1141 (42000): There is no such grant defined for user ' test ' on host ' 127.0.0.1 '
[Email protected]:mysql3306.sock 14:03: [test]>revoke Update on TEST.A from [email protected] ' 127.0.0.1 ';
ERROR 1147 (42000): There is no such grant defined for user ' test ' on host ' 127.0.0.1 ' on table ' a '
MySQL account permissions