顯示 MySQL 中使用者的所有許可權
使用 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)
廣告
資料結構
網路
關係型資料庫管理系統
作業系統
Java
iOS
HTML
CSS
Android
Python
C 語言程式設計
C++
C#
MongoDB
MySQL
Javascript
PHP