This repository has been archived on 2024-01-15. You can view files and clone it, but cannot push or open issues or pull requests.
vn-mysql/proxy-auth/test/test.sql

24 lines
649 B
SQL

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