「MariaDB」テーブルの権限情報を取得する方法
環境
MariaDB 10.6.4
操作例
「information_schema」の「TABLE_PRIVILEGES」を確認して、テーブルの権限情報を取得します。
SQL構文
select *from information_schema.TABLE_PRIVILEGES;
実行結果
MariaDB [testdb]> select *from information_schema.TABLE_PRIVILEGES; +---------------------------+---------------+--------------+-------------+----------------+--------------+ | GRANTEE | TABLE_CATALOG | TABLE_SCHEMA | TABLE_NAME | PRIVILEGE_TYPE | IS_GRANTABLE | +---------------------------+---------------+--------------+-------------+----------------+--------------+ | 'mariadb.sys'@'localhost' | def | mysql | global_priv | SELECT | NO | | 'mariadb.sys'@'localhost' | def | mysql | global_priv | DELETE | NO | +---------------------------+---------------+--------------+-------------+----------------+--------------+ 2 rows in set (0.426 sec)