Use MySQL proxies_priv (simulated role) to implement similar user group management Roles can be used to manage users in batches. Users with the same role have the same permissions. MySQL 5.7.X and later can simulate the role function, which can be achieved through mysql.proxies_priv simulation 1. Configure proxy mysql> show variables like "%proxy%"; #Check whether the current proxy is enabled. The following figure shows that it is not enabled. mysql> set global check_proxy_users = on; #Enable proxy. The following figure shows that proxy is enabled.mysql> set global mysql_native_password_proxy_users = on; mysql> exit Bye #The above parameters are invalid for the current session. You need to log out and log in again, or set them directly in my.cnf 2. Create a user mysql> create user will_dba; #Similar groupmysql> create user 'will'; mysql> create user 'tom'; #The password is not set. If you need to set a 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. Check will_dba's permissions mysql> show grants for will_dba; 6. Check the permissions of will and tom mysql> show grants for will; mysql> show grants for tom; 7. Check the permissions of proxies_priv mysql> select * from mysql.proxies_priv; 8. Verification Use will and tom users to view the database [root@test-1 ~]# mysql -utom -p mysql> show databases; #We did not grant permissions to user tom before, but he can view it here mysql> show tables; mysql> select * from user\G mysql.proxies_priv is just a simulation of Role, which is different from Oracle's role. The official name is Role like MySQL5.6.X needs to install a plug-in to simulate the Role function. For specific methods, please refer to: 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 the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
>>: An example of how to quickly deploy web applications using Tomcat in Docker
need: Implement dynamic display of option values ...
In fact, we have been hearing a lot about web des...
Table of contents definition Constructor bodies a...
My machine environment: Windows 2008 R2 MySQL 5.6...
The PHP base image used in this article is: php:7...
Table of contents Canvas related documents Effect...
Preface In addition to the default built-in direc...
In the past, I used to directly order by rand() t...
Table of contents docker system df docker system ...
Recently I saw the article Build your own React o...
When developing a project, you will often encount...
Table of contents 1. What is an event? 2. Enable ...
Table of contents The problem here is: Solution 1...
Table of contents 1. Component Communication 1. P...
MySQL master-slave setup MySQL master-slave repli...