国产探花免费观看_亚洲丰满少妇自慰呻吟_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ā)表
主站蜘蛛池模板: 新兴县| 商水县| 丹东市| 湘乡市| 察隅县| 凯里市| 湟中县| 丹江口市| 天等县| 庆元县| 托里县| 麻城市| 德格县| 克东县| 昌宁县| 嘉义市| 湖北省| 宣化县| 大连市| 聊城市| 六枝特区| 红桥区| 扬中市| 确山县| 乌兰浩特市| 平湖市| 德安县| 廊坊市| 新建县| 揭西县| 合山市| 荣成市| 杭锦旗| 尼木县| 北安市| 六盘水市| 大足县| 彰化市| 廊坊市| 龙陵县| 宁国市|