INFORMATION_SCHEMA.SCHEMA_PRIVILEGES를 사용하여 사용자에 대한 모든 권한 표시 -
select *from INFORMATION_SCHEMA.SCHEMA_PRIVILEGES;
사용자에 대한 모든 권한을 표시하기 위해 위의 구문을 구현해 보겠습니다. -
mysql> select *from INFORMATION_SCHEMA.SCHEMA_PRIVILEGES;
이것은 다음과 같은 출력을 생성합니다 -
+-----------------------------+---------------+--------------------+-------------------------+--------------+ | GRANTEE | TABLE_CATALOG | TABLE_SCHEMA | PRIVILEGE_TYPE | IS_GRANTABLE | +-----------------------------+---------------+--------------------+-------------------------+--------------+ | 'mysql.sys'@'localhost' | def | sys | TRIGGER | NO | | 'Adam Smith'@'localhost' | def | test | SELECT | NO | | 'Adam Smith'@'localhost' | def | test | INSERT | NO | | 'Adam Smith'@'localhost' | def | test | UPDATE | NO | | 'Adam Smith'@'localhost' | def | test | DELETE | NO | | 'Adam Smith'@'localhost' | def | test | CREATE | NO | | 'Adam Smith'@'localhost' | def | test | DROP | NO | | 'Adam Smith'@'localhost' | def | test | REFERENCES | NO | | 'Adam Smith'@'localhost' | def | test | INDEX | NO | | 'Adam Smith'@'localhost' | def | test | ALTER | NO | | 'Adam Smith'@'localhost' | def | test | CREATE TEMPORARY TABLES | NO | | 'Adam Smith'@'localhost' | def | test | LOCK TABLES | NO | | 'Adam Smith'@'localhost' | def | test | EXECUTE | NO | | 'Adam Smith'@'localhost' | def | test | CREATE VIEW | NO | | 'Adam Smith'@'localhost' | def | test | SHOW VIEW | NO | | 'Adam Smith'@'localhost' | def | test | CREATE ROUTINE | NO | | 'Adam Smith'@'localhost' | def | test | ALTER ROUTINE | NO | | 'Adam Smith'@'localhost' | def | test | EVENT | NO | | 'Adam Smith'@'localhost' | def | test | TRIGGER | NO | | 'David'@'localhost' | def | test | SELECT | NO | | 'David'@'localhost' | def | test | INSERT | NO | | 'David'@'localhost' | def | test | UPDATE | NO | | 'David'@'localhost' | def | test | DELETE | NO | | 'David'@'localhost' | def | test | CREATE | NO | | 'David'@'localhost' | def | test | REFERENCES | NO | | 'David'@'localhost' | def | test | ALTER | NO | | 'mysql.session'@'localhost' | def | performance_schema | SELECT | NO | | 'Robert'@'%' | def | sample | SELECT | YES | | 'Robert'@'%' | def | sample | INSERT | YES | | 'Robert'@'%' | def | sample | UPDATE | YES | | 'Robert'@'%' | def | sample | DELETE | YES | | 'Robert'@'%' | def | sample | CREATE | YES | | 'Robert'@'%' | def | sample | DROP | YES | | 'Robert'@'%' | def | sample | REFERENCES | YES | | 'Robert'@'%' | def | sample | INDEX | YES | | 'Robert'@'%' | def | sample | ALTER | YES | | 'Robert'@'%' | def | sample | CREATE TEMPORARY TABLES | YES | | 'Robert'@'%' | def | sample | LOCK TABLES | YES | | 'Robert'@'%' | def | sample | EXECUTE | YES | | 'Robert'@'%' | def | sample | CREATE VIEW | YES | | 'Robert'@'%' | def | sample | SHOW VIEW | YES | | 'Robert'@'%' | def | sample | CREATE ROUTINE | YES | | 'Robert'@'%' | def | sample | ALTER ROUTINE | YES | | 'Robert'@'%' | def | sample | EVENT | YES | | 'Robert'@'%' | def | sample | TRIGGER | YES | | 'Robert'@'%' | def | web | EXECUTE | NO | +-----------------------------+---------------+--------------------+-------------------------+--------------+ 46 rows in set (0.00 sec)