2.3.5 mysql角色管理
生活随笔
收集整理的這篇文章主要介紹了
2.3.5 mysql角色管理
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
--04、用戶角色管理 mysql5.7:proxies_priv(模擬角色),可以實現用戶組的管理 角色(roLe)可以批量管理用戶,同一個角色下面的數據都有相同的權限 mysql 5.7是通過 mysql.proxies_priv來模擬實現。 參數: check_proxy_users=on mysqL_native_password_proxy_users=on 01.啟用 proxy show variables like '%proxy%' mysql root@localhost:mysql> show variables like '%proxy%' +-----------------------------------+-------+ | Variable_name? ? ? ? ? ? ? ? ? ?? | Value | +-----------------------------------+-------+ | check_proxy_users? ? ? ? ? ? ? ?? | OFF?? | | mysql_native_password_proxy_users | OFF?? | | proxy_user? ? ? ? ? ? ? ? ? ? ? ? |? ? ?? | | sha256_password_proxy_users? ? ?? | OFF?? | +-----------------------------------+-------+ set global check_proxy_users=on set global mysql_native_password_proxy_users=on 如果永久打開,需要加入到my.cnf參數文件中,重啟生效 02.創建用戶 create user 'itpux_dba' #類似組/角色 create user itpux11 create user itpux12 create user itpux13 03.將 itpux_dba權限映射到 itpux11/ itpux12 grant proxy on itpux_dba to itpux11 grant proxy on itpux_dba to itpux12 04.給 itpux_dba(模擬的role)賦予實際的權限 grant select on itpux.* to itpux_dba flush privileges; 05.檢查權限并測試 show grants for itpux_dba show grants for itpux11 show grants for itpux12 show grants for itpux13 select * from mysql.proxies_priv 然后分別用4個用戶登錄測試。 06.代理權限取消 revoke proxy on itpux_dba from itpux11
總結
以上是生活随笔為你收集整理的2.3.5 mysql角色管理的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 常见的攻击方法
- 下一篇: ERROR 1819 (HY000):