MySQL权限篇之ALL与SUPER

ALL权限,顾名思义就是所有权限,这个权限很大,并且with grant option。

这里说错了,其实ALL权限也不with grant option。任何权限都不包括grant option。

而SUPER权限,我个人理解就是ALL权限并且without grant option。不知道是否是这样?!

SUPER权限和all还是有很大区别,比如SHUTDOWN的权限super就没有,而all就有。

mysql> show grants for 'ut01'@'%';
+----------------------------------+
| Grants for ut01@%                |
+----------------------------------+
| GRANT USAGE ON *.* TO 'ut01'@'%' |
+----------------------------------+
1 row in set (0.00 sec)


mysql> grant all on *.* to 'ut01'@'%';
Query OK, 0 rows affected (0.05 sec)


mysql> show grants for 'ut01'@'%';
+-------------------------------------------+
| Grants for ut01@%                         |
+-------------------------------------------+
| GRANT ALL PRIVILEGES ON *.* TO 'ut01'@'%' |
+-------------------------------------------+
1 row in set (0.00 sec)


mysql> revoke all on *.* from 'ut01'@'%';
Query OK, 0 rows affected (0.05 sec)


mysql> show grants for 'ut01'@'%';
+----------------------------------+
| Grants for ut01@%                |
+----------------------------------+
| GRANT USAGE ON *.* TO 'ut01'@'%' |
+----------------------------------+
1 row in set (0.00 sec)


mysql> grant super on *.* to 'ut01'@'%';
Query OK, 0 rows affected (0.05 sec)


mysql> show grants for 'ut01'@'%';
+----------------------------------+
| Grants for ut01@%                |
+----------------------------------+
| GRANT SUPER ON *.* TO 'ut01'@'%' |
+----------------------------------+
1 row in set (0.00 sec)


mysql> revoke super on *.* from 'ut01'@'%';
Query OK, 0 rows affected (0.05 sec)


mysql> show grants for 'ut01'@'%';
+----------------------------------+
| Grants for ut01@%                |
+----------------------------------+
| GRANT USAGE ON *.* TO 'ut01'@'%' |
+----------------------------------+
1 row in set (0.00 sec)


mysql>

一般地,all和super这两个权限要注意保护。不能随便授予。

你可能感兴趣的:(MySQL数据库-权限)