Bug #102592 mysql select @@proxy_user not displayed
Submitted: 14 Feb 2021 3:19 Modified: 15 Feb 2021 15:14
Reporter: HULONG CUI Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:8.0.23 OS:Any
Assigned to: CPU Architecture:Any

[14 Feb 2021 3:19] HULONG CUI
Description:
#Environment:
1.mysql GA version8.0.23
2.using default_authentication_plugin = mysql_native_password

#SQL:
DROP USER IF EXISTS   'employee_proxy'@'%';
DROP USER IF EXISTS  'employee'@'localhost';

-- create proxy account 
CREATE USER 'employee_proxy'@'%' identified by '123456';

-- create proxied account and grant its privileges;
CREATE USER 'employee'@'localhost'  identified by '123456';
GRANT ALL   ON *.*   TO 'employee'@'localhost';

-- grant to proxy account the
GRANT PROXY   ON 'employee'@'localhost'    TO 'employee_proxy'@'%';

mysql -uemployee_proxy -p -h192.168.244.129 -P3380

employee_proxy@192.168.244.129: 11:06:  [(none)]> SELECT USER(), CURRENT_USER(), @@proxy_user;
+---------------------+------------------+--------------+
| USER()              | CURRENT_USER()   | @@proxy_user |
+---------------------+------------------+--------------+
| employee_proxy@ens8 | employee_proxy@% | NULL         |
+---------------------+------------------+--------------+
not displayed @@proxy_user info

--also check proxies_priv to have info
root@localhost: 11:18:  [mysql]> select * from mysql.proxies_priv;
+-----------+----------------+--------------+--------------+------------+----------------+---------------------+
| Host      | User           | Proxied_host | Proxied_user | With_grant | Grantor        | Timestamp           |
+-----------+----------------+--------------+--------------+------------+----------------+---------------------+
| %         |                | localhost    | accounting   |          0 | root@localhost | 0000-00-00 00:00:00 |
| %         | employee_proxy | localhost    | employee     |          0 | root@localhost | 0000-00-00 00:00:00 |
| localhost | root           |              |              |          1 | boot@          | 0000-00-00 00:00:00 |
+-----------+----------------+--------------+--------------+------------+----------------+---------------------+

How to repeat:
repeat info Description
[14 Feb 2021 3:24] HULONG CUI
i have setting my.cnf ,but  is not displayed
[mysqld]
check_proxy_users=ON
mysql_native_password_proxy_users=ON
[14 Feb 2021 3:38] HULONG CUI
i have give all privileges also proxy function unavailable:
employee_proxy@192.168.244.129: 11:34:  [(none)]> use db1;
ERROR 1044 (42000): Access denied for user 'employee_proxy'@'%' to database 'db1'
[15 Feb 2021 15:14] MySQL Verification Team
Hi Mr. jacky,

Thank you for your bug report.

However, it is not a bug.

Simply, you have not user the authentication plugin that supports proxy users.

In the case that you have used one, your settings would have worked.

This is all described in our Reference Manual.