2021-07-16 03:21:50 +00:00
|
|
|
DROP USER IF EXISTS test_user_01999;
|
|
|
|
|
|
|
|
CREATE USER test_user_01999;
|
|
|
|
SHOW CREATE USER test_user_01999;
|
|
|
|
|
|
|
|
SELECT 'A';
|
|
|
|
SHOW GRANTS FOR test_user_01999;
|
|
|
|
|
|
|
|
GRANT SELECT ON db1.* TO test_user_01999;
|
2021-07-18 08:58:48 +00:00
|
|
|
GRANT SHOW ON db2.tb2 TO test_user_01999;
|
2021-07-16 03:21:50 +00:00
|
|
|
|
|
|
|
SELECT 'B';
|
|
|
|
SHOW GRANTS FOR test_user_01999;
|
|
|
|
|
2021-07-21 15:08:38 +00:00
|
|
|
GRANT SELECT(col1) ON db3.table TO test_user_01999 WITH REPLACE OPTION;
|
2021-07-16 03:21:50 +00:00
|
|
|
|
|
|
|
SELECT 'C';
|
|
|
|
SHOW GRANTS FOR test_user_01999;
|
|
|
|
|
2021-07-21 15:08:38 +00:00
|
|
|
GRANT SELECT(col3) ON db3.table3, SELECT(col1, col2) ON db4.table4 TO test_user_01999 WITH REPLACE OPTION;
|
2021-07-16 03:21:50 +00:00
|
|
|
|
|
|
|
SELECT 'D';
|
|
|
|
SHOW GRANTS FOR test_user_01999;
|
|
|
|
|
2021-07-21 15:08:38 +00:00
|
|
|
GRANT SELECT(cola) ON db5.table, INSERT(colb) ON db6.tb61, SHOW ON db7.* TO test_user_01999 WITH REPLACE OPTION;
|
2021-07-16 03:21:50 +00:00
|
|
|
|
|
|
|
SELECT 'E';
|
|
|
|
SHOW GRANTS FOR test_user_01999;
|
|
|
|
|
|
|
|
SELECT 'F';
|
2021-07-21 15:08:38 +00:00
|
|
|
GRANT SELECT ON all.* TO test_user_01999 WITH REPLACE OPTION;
|
2021-07-16 09:05:57 +00:00
|
|
|
SHOW GRANTS FOR test_user_01999;
|
|
|
|
|
|
|
|
SELECT 'G';
|
2021-07-21 15:08:38 +00:00
|
|
|
GRANT USAGE ON *.* TO test_user_01999 WITH REPLACE OPTION;
|
2021-07-16 03:21:50 +00:00
|
|
|
SHOW GRANTS FOR test_user_01999;
|
|
|
|
|
2021-07-18 08:58:48 +00:00
|
|
|
SELECT 'H';
|
|
|
|
DROP ROLE IF EXISTS test_role_01999;
|
|
|
|
CREATE role test_role_01999;
|
|
|
|
GRANT test_role_01999 to test_user_01999;
|
|
|
|
GRANT SELECT ON db1.tb1 TO test_user_01999;
|
|
|
|
SHOW GRANTS FOR test_user_01999;
|
|
|
|
|
|
|
|
SELECT 'I';
|
2021-07-21 15:08:38 +00:00
|
|
|
GRANT NONE ON *.* TO test_user_01999 WITH REPLACE OPTION;
|
2021-07-18 08:58:48 +00:00
|
|
|
SHOW GRANTS FOR test_user_01999;
|
|
|
|
|
|
|
|
SELECT 'J';
|
|
|
|
GRANT SHOW ON db8.* TO test_user_01999;
|
|
|
|
SHOW GRANTS FOR test_user_01999;
|
|
|
|
|
|
|
|
SELECT 'K';
|
2021-07-21 15:08:38 +00:00
|
|
|
GRANT NONE TO test_user_01999 WITH REPLACE OPTION;
|
2021-07-18 08:58:48 +00:00
|
|
|
SHOW GRANTS FOR test_user_01999;
|
|
|
|
|
2021-07-23 13:37:55 +00:00
|
|
|
SELECT 'L';
|
|
|
|
GRANT NONE ON *.*, SELECT on db9.tb3 TO test_user_01999 WITH REPLACE OPTION;
|
|
|
|
SHOW GRANTS FOR test_user_01999;
|
|
|
|
|
|
|
|
SELECT 'M';
|
|
|
|
GRANT test_role_01999 to test_user_01999;
|
|
|
|
SHOW GRANTS FOR test_user_01999;
|
|
|
|
|
|
|
|
SELECT 'N';
|
|
|
|
DROP ROLE IF EXISTS test_role_01999_1;
|
|
|
|
CREATE role test_role_01999_1;
|
|
|
|
GRANT NONE, test_role_01999_1 TO test_user_01999 WITH REPLACE OPTION;
|
|
|
|
SHOW GRANTS FOR test_user_01999;
|
|
|
|
|
2021-07-18 08:58:48 +00:00
|
|
|
DROP USER IF EXISTS test_user_01999;
|
|
|
|
DROP ROLE IF EXISTS test_role_01999;
|
2021-07-23 13:37:55 +00:00
|
|
|
DROP ROLE IF EXISTS test_role_01999_1;
|
2021-07-16 03:21:50 +00:00
|
|
|
|
2021-07-23 13:37:55 +00:00
|
|
|
SELECT 'O';
|