MySQL 权限管理

2021-07-01  本文已影响0人  Joening

查询所有权限:

mysql> show privileges;

授权

mysql> grant all on *.* to qiaoning@'10.0.0.%';

查看权限

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

回收权限

mysql> revoke drop on *.* from qiaoning@'10.0.0.%';
Query OK, 0 rows affected (0.00 sec)

查看权限

mysql> show grants for qiaoning@'10.0.0.%';
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Grants for qiaoning@10.0.0.%                                                                                                                                                                                                                                                                                                                                |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE ON *.* TO 'qiaoning'@'10.0.0.%' |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
上一篇下一篇

猜你喜欢

热点阅读