Get the App
SLTechnology News&Howtos  ›  Database  › 

Mysql 5.7.18 how to implement similar user Group Management with MySQL proxies_priv

Shulou Source: shulou.com Published: 2022-06-01 02:12:52 11月16日 Update

This article mainly introduces Mysql 5.7.18 how to use MySQL proxies_priv to achieve similar user group management, has a certain reference value, friends in need can refer to. I hope you will learn a lot after reading this article. Next, let the editor take you to learn about it.

Using MySQL proxies_priv (simulated role) to realize similar user group management

Roles (Role) can be used to manage users in batches. Users under the same role have the same permissions.

MySQL5.7.X can later simulate the function of Role, which can be realized by 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 indicates that mysql > set global mysql_native_password_proxy_users = on is enabled

The above parameters set in mysql > exitBye # are not valid for the current session. You need to log in again after exiting, or set them directly to my.cnf.

2. Create a user

Mysql > create user will_dba; # similar group mysql > create user 'will';mysql > create user' tom'; # password is not set. If you need to set the password, add identified by '123' after it.

3. Map the permissions of will_dba (map) to will,tom

Mysql > grant proxy on will_dba to will;mysql > grant proxy on will_dba to tom

4. Give actual permissions to will_dba (simulated Role)

Mysql > grant select on *. * to will_dba

5. View the permissions of will_dba

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 the permissions of proxies_priv

Mysql > mysql > select * from mysql.proxies_priv

8. Verification

Use will and tom users to view the database

[root@test-1 ~] # mysql-utom-pmysql > show databases; # tom user we didn't grant permission before, but you can see mysql > show tables;mysql > select * from user\ G here.

Mysql.proxies_priv is only a simulation of Role, and the role of Oracle is still different. Officially known as Role like.

Thank you for reading this article carefully, I hope the editor can share Mysql 5.7.18 how to use MySQL proxies_priv to achieve similar user group management content is helpful to everyone, but also hope that you support a lot, pay attention to the industry information channel, find problems, detailed solutions waiting for you to learn!

Tags: Users permissions roles management user groups articles following figure password different same value content function parameter at the same time official actual data database method Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Information Linux Shulou Tech Info vpn MySQL