Mysql 5.7.18 uses MySQL proxies_priv to manage similar user groups, 5.7.18proxies _ priv

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.