--disable_warnings DROP USER IF EXISTS user_native_grant; DROP USER IF EXISTS user_role_grant; DROP ROLE IF EXISTS test_role; DROP DATABASE IF EXISTS d1; --enable_warnings CREATE DATABASE d1; CREATE ROLE test_role; GRANT SELECT ON *.* TO test_role; CREATE USER user_role_grant DEFAULT ROLE test_role; CREATE USER user_native_grant; GRANT SELECT ON *.* TO user_native_grant; --echo user_native_grant connect (native_grant_connection, localhost, user_native_grant,, d1); connection native_grant_connection; SHOW CREATE DATABASE d1; disconnect native_grant_connection; --echo user_role_grant connect (role_grant_connection, localhost, user_role_grant,, d1); connection role_grant_connection; SHOW CREATE DATABASE d1; disconnect role_grant_connection; connection default; DROP USER user_native_grant; DROP USER user_role_grant; DROP ROLE test_role; DROP DATABASE d1;