
CREATE SCHEMA account;

DROP TABLE IF EXISTS account.user;
CREATE TABLE account.user
SELECT 'proxy' mysql_user, 'test-user' user, '1234' password;

DROP USER 'proxy-auth'@'%';
CREATE USER 'proxy-auth'@'%' IDENTIFIED BY 'password';
GRANT SELECT ON TABLE account.user TO 'proxy-auth'@'%';

DROP USER ''@'%';
CREATE USER ''@'%' IDENTIFIED WITH proxy_auth;
GRANT USAGE ON *.* TO ''@'%';

DROP USER 'proxy'@'%';
CREATE USER 'proxy'@'%' IDENTIFIED BY '123456';
GRANT USAGE ON *.* TO 'proxy'@'%';
GRANT PROXY ON 'proxy'@'%' TO ''@'%';

-- Use this query on /etc/mysql/proxy-auth.ini
-- SELECT mysql_user FROM user WHERE user = #user AND password = #pass

