Using proxysql-admin --syncusers with more than one admin user add the user to mysql_users
General
Escalation
General
Escalation
Description
Running the proxysql-admin --syncusers with more than one admin user creates the remaining one on mysql_users:
MySQL [(none)]> show global variables;
+----------------------------------------------------------------------+-----------------------------+
| Variable_name | Value |
+----------------------------------------------------------------------+-----------------------------+
| admin-admin_credentials | admin:admin;radmin:radmin |
[...]
+----------------------------------------------------------------------+-----------------------------+
Running the syncusers:
# proxysql-admin --config-file=/etc/proxysql-admin.cnf --syncusers
Syncing user accounts from PXC(10.124.33.21:3306) to ProxySQL
Adding user to ProxySQL: radmin
Removing existing user from ProxySQL: root
Adding user to ProxySQL: root
Removing existing user from ProxySQL: root
Adding user to ProxySQL: root
Synced PXC users to the ProxySQL database!
Once the admin is created on mysql_users, it cannot access proxysql again:
2024-02-09 00:24:17 MySQL_Session.cpp:5682:handler___status_CONNECTING_CLIENT___STATE_SERVER_HANDSHAKE(): [ERROR] ProxySQL Error: Access denied for user 'radmin'@'10.124.33.159' (using password: YES)
Running the proxysql-admin --syncusers with more than one admin user creates the remaining one on mysql_users:
MySQL [(none)]> show global variables; +----------------------------------------------------------------------+-----------------------------+ | Variable_name | Value | +----------------------------------------------------------------------+-----------------------------+ | admin-admin_credentials | admin:admin;radmin:radmin | [...] +----------------------------------------------------------------------+-----------------------------+
Running the syncusers:
# proxysql-admin --config-file=/etc/proxysql-admin.cnf --syncusers Syncing user accounts from PXC(10.124.33.21:3306) to ProxySQL Adding user to ProxySQL: radmin Removing existing user from ProxySQL: root Adding user to ProxySQL: root Removing existing user from ProxySQL: root Adding user to ProxySQL: root Synced PXC users to the ProxySQL database!
Once the admin is created on mysql_users, it cannot access proxysql again:
2024-02-09 00:24:17 MySQL_Session.cpp:5682:handler___status_CONNECTING_CLIENT___STATE_SERVER_HANDSHAKE(): [ERROR] ProxySQL Error: Access denied for user 'radmin'@'10.124.33.159' (using password: YES)
Due to the following:
https://proxysql.com/Documentation/global-variables/admin-variables/#admin-admin_credentials:~:text=users%20defined%20in%20admin%2Dadmin_credentials%20or%20admin%2Dstats_credentials%20cannot%20be%20used%20also%20in%20mysql_users%20table.