国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 數(shù)據(jù)庫 > MySQL > 正文

MySQL 5.7的角色功能

2024-07-24 12:35:35
字體:
供稿:網(wǎng)友
  MySQL 5.7的角色功能:
 
  創(chuàng)建用戶并授予用戶角色功能:
 
  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)

(編輯:武林網(wǎng))

發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 湘乡市| 大安市| 阳城县| 岳阳县| 满洲里市| 沅江市| 温泉县| 获嘉县| 中江县| 施甸县| 五大连池市| 石台县| 个旧市| 梁山县| 吴桥县| 钟祥市| 贵定县| 教育| 高邮市| 于都县| 民县| 科技| 长春市| 沅江市| 新安县| 天长市| 新乐市| 浮梁县| 十堰市| 澄迈县| 蓬溪县| 阿瓦提县| 黄山市| 东莞市| 讷河市| 北京市| 象州县| 潜江市| 固安县| 嘉禾县| 内江市|