MySQL 5.7的角色功能
MySQL 5.7的角色功能:
建立使用者並授予使用者角色功能:
mysql> create user 'junior'@'127.0.0.1' identified by '123';
Query OK, 0 rows affected (0.01 sec)
mysql> create user 'tom'@'127.0.0.1' identified by '123';
Query OK, 0 rows affected (0.00 sec)
mysql> create user 'jim'@'127.0.0.1' identified by '123';
Query OK, 0 rows affected (0.01 sec)
mysql> grant proxy on 'junior'@'127.0.0.1' to 'tom'@'127.0.0.1';
Query OK, 0 rows affected (0.01 sec)
mysql> grant proxy on 'junior'@'127.0.0.1' to 'jim'@'127.0.0.1';
Query OK, 0 rows affected (0.00 sec)
mysql> grant select on *.* to 'junior'@'127.0.0.1';
Query OK, 0 rows affected (0.00 sec)
mysql> show grants for 'junior'@'127.0.0.1';
+---------------------------------------------+
| Grants for junior@127.0.0.1 |
+---------------------------------------------+
| GRANT SELECT ON *.* TO 'junior'@'127.0.0.1' |
+---------------------------------------------+
1 row in set (0.00 sec)
mysql> show grants for 'jim'@'127.0.0.1';
+----------------------------------------------------------+
| Grants for jim@127.0.0.1 |
+----------------------------------------------------------+
| GRANT USAGE ON *.* TO 'jim'@'127.0.0.1' |
| GRANT PROXY ON 'junior'@'127.0.0.1' TO 'jim'@'127.0.0.1' |
+----------------------------------------------------------+
2 rows in set (0.00 sec)
mysql> show grants for 'tom'@'127.0.0.1';
+----------------------------------------------------------+
| Grants for tom@127.0.0.1 |
+----------------------------------------------------------+
| GRANT USAGE ON *.* TO 'tom'@'127.0.0.1' |
| GRANT PROXY ON 'junior'@'127.0.0.1' TO 'tom'@'127.0.0.1' |
+----------------------------------------------------------+
2 rows in set (0.00 sec)
mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> select * from proxies_priv;
+-----------+------+--------------+--------------+------------+----------------------+---------------------+
| Host | User | Proxied_host | Proxied_user | With_grant | Grantor | Timestamp |
+-----------+------+--------------+--------------+------------+----------------------+---------------------+
| localhost | root | | | 1 | boot@connecting host | 0000-00-00 00:00:00 |
| 127.0.0.1 | tom | 127.0.0.1 | junior | 0 | root@localhost | 0000-00-00 00:00:00 |
| 127.0.0.1 | jim | 127.0.0.1 | junior | 0 | root@localhost | 0000-00-00 00:00:00 |
+-----------+------+--------------+--------------+------------+----------------------+---------------------+
3 rows in set (0.00 sec)
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/22996654/viewspace-2654563/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- MySQL5.7&8.0許可權-角色管理MySql
- mysql 5.7 虛擬列功能MySql
- MySQL角色(role)功能介紹MySql
- MySQL5.7審計功能windows系統MySqlWindows
- mysql 5.7新增server_audit 安全審計功能MySqlServer
- MySQL8 的分割槽功能相比 mysql5.7 有什麼改進?MySql
- 【MySQL】MySQL 5.7 初探MySql
- mysql 5.7中嶄新的 mysql sys schemaMySql
- MySQL 5.7新特性MySql
- 使用Docker Mysql 5.7DockerMySql
- Docker 部署 MySQL 5.7DockerMySql
- MySQL 5.7 SYS SCHEMAMySql
- MySQL 5.7的主要特性簡介MySql
- MySQL 5.7 ORDER BY排序的優化MySql排序優化
- MySQL 5.7 REPLACE語句的用法MySql
- 【Mysql】Mysql5.7的多源複製搭建MySql
- 【Mysql】mysql閃回flashback-5.7MySql
- Install MySQL 5.7 in the DockerMySqlDocker
- MySQL 5.7 叢集搭建MySql
- Mysql 5.7 MHA 高可用MySql
- MySQL:5.6 升級 5.7MySql
- Docker 安裝 Mysql 5.7DockerMySql
- MySQL 5.7 InnoDB Tablespace EncryptionMySql
- MySQL5.7 多例項MySql
- mysql 5.7主主同步MySql
- MySQL 5.7 索引優化MySql索引優化
- mysql5.7MHA配置MySql
- mysql5.7tar包的安裝MySql
- MySQL 5.7定位消耗CPU高的SQLMySql
- MySQL 5.7許可權的介紹MySql
- 【Mysql】mysql5.7新特性之-sys schema的作用MySql
- [Mysql]Mysql5.7並行複製MySql並行
- [Mysql] 2.Mysql 5.7 Install (Windows)MySqlWindows
- 【Mysql】mysql5.7無損複製MySql
- MySQL 5.7並行複製MySql並行
- mysql 5.7半同步複製MySql
- MySQL 5.7:desc order by反向定位MySql
- MySQL5.7: sql script demoMySql