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)
mysq开发云主机域名l> 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)

相关推荐: Mycat的使用 – 04.事务支持

03全局序列号篇详细介绍了分片表, 业务在使用分片表时, 很自然的可能会遇到一个事务中操作的数据分布在多个分片节点上, 即分布式事务. 先来直观感受下Mycat处理事务的过程.登陆tb3表的dnTest2节点主机, 操作如下.mysql> set glo…

免责声明:本站发布的图片视频文字,以转载和分享为主,文章观点不代表本站立场,本站不承担相关法律责任;如果涉及侵权请联系邮箱:360163164@qq.com举报,并提供相关证据,经查实将立刻删除涉嫌侵权内容。

(0)
打赏 微信扫一扫 微信扫一扫
上一篇 06/04 21:38
下一篇 06/04 21:38

相关推荐