The mysql.tables_priv table contains information about table-level privileges. The table can be queried and although it is possible to directly update it, it is best to use GRANT for setting privileges.

Note that the MariaDB privileges occur at many levels. A user may be granted a privilege at the table level, but may still not have permission on a database level, for example. See privileges for a more complete view of the MariaDB privilege system.

The INFORMATION_SCHEMA.TABLE_PRIVILEGES table derives its contents from mysql.tables_priv.

The mysql.tables_priv table contains the following fields:

FieldTypeNullKeyDefaultDescription
Hostchar(60)NOPRIHost (together with User, Db and Table_namemakes up the unique identifier for this record.
Dbchar(64)NOPRIDatabase (together with User, Host and Table_namemakes up the unique identifier for this record.
Userchar(80)NOPRIUser (together with Host, Db and Table_namemakes up the unique identifier for this record.
Table_namechar(64)NOPRITable name (together with User, Db and Tablemakes up the unique identifier for this record.
Grantorchar(141)NOMUL
TimestamptimestampNOCURRENT_TIMESTAMP
Table_privset('Select', 'Insert', 'Update', 'Delete', 'Create', 'Drop', 'Grant', 'References', 'Index', 'Alter', 'Create View', 'Show view', 'Trigger')NOThe table privilege type. See Table Privileges for details.
Column_privset('Select', 'Insert', 'Update', 'References')NOThe column privilege type. See Column Privileges for details.

The Acl_table_grants status variable, added in MariaDB 10.1.4, indicates how many rows the mysql.tables_priv table contains.

Comments

Comments loading...