Mysql 5.7.18 uses MySQL proxies_priv to manage similar user groups, 5.7.18proxies _ priv
Use MySQL proxies_priv (role simulation) to manage similar user groups
Roles can be used to manage users in batches. users under the same Role have the same permissions.
After MySQL5.7.X, you can simulate the Role function through mysql. proxies_priv simulation.
1. Configure proxy
Mysql> show variables like "% proxy %"; # Check whether the current proxy is enabled, indicating that it is not enabled
Mysql> set global check_proxy_users = on; # enabling proxy indicates that mysql> set global mysql_native_password_proxy_users = on is enabled;
Mysql> exitBye # the above parameters are invalid for the current session. You need to log out and log on again, or directly set them to my. cnf.
2. Create a user
Mysql> create user will_dba; # similar to mysql> create user 'will '; mysql> create user 'Tom'; # The password is not set, to set the password, add identified by '123'
3. map the permissions of will_dba to will, tom
mysql> grant proxy on will_dba to will;mysql> grant proxy on will_dba to tom;
4. Grant actual permissions to will_dba (simulated Role)
mysql> grant select on *.* to will_dba;
5. View will_dba Permissions
mysql> show grants for will_dba;
6. view the permissions of will and tom.
mysql> show grants for will;
mysql> show grants for tom;
7. View proxies_priv Permissions
mysql> mysql> select * from mysql.proxies_priv;
8. Verification
Use the will and tom users to view the database
[Root @ test-1 ~] # Mysql-utom-pmysql> show databases; # We didn't grant permissions to the tom user, but here we can view mysql> show tables; mysql> select * from user \ G
Mysql. proxies_priv is only a simulation of Role, which is different from the Role of Oracle. It is officially called Role like
Plug-ins need to be installed to simulate the Role function of MySQL5.6.X. For details, refer:
Https://dev.mysql.com/doc/refman/5.6/en/proxy-users.html
Https://dev.mysql.com/doc/refman/5.6/en/pluggable-authentication.html
The above is all the content of this article. I hope it will be helpful for your learning and support for helping customers.