mysql.columns_priv Table

The mysql.columns_priv table contains information about column-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 column level, but may still not have permission on a table level, for example. See privileges for a more complete view of the MariaDB privilege system.

The INFORMATION_SCHEMA.COLUMN_PRIVILEGES table derives its contents from mysql.columns_priv.

MariaDB starting with 10.4

In MariaDB 10.4 and later, this table uses the Aria storage engine.

MariaDB until 10.3

In MariaDB 10.3 and before, this table uses the MyISAM storage engine.

The mysql.columns_priv table contains the following fields:

FieldTypeNullKeyDefaultDescription
Hostchar(60)NOPRIHost (together with User, Db , Table_name andColumn_name makes up the unique identifier for this record.
Dbchar(64)NOPRIDatabase name (together with User, Host , Table_name andColumn_name makes up the unique identifier for this record.
Userchar(80)NOPRIUser (together with Host, Db , Table_name andColumn_name makes up the unique identifier for this record.
Table_namechar(64)NOPRITable name (together with User, Db , Host andColumn_name makes up the unique identifier for this record.
Column_namechar(64)NOPRIColumn name (together with User, Db , Table_name andHost makes up the unique identifier for this record.
TimestamptimestampNOCURRENT_TIMESTAMP
Column_privset('Select', 'Insert', 'Update', 'References')NOThe privilege type. See Column Privileges for details.

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

Comments

Comments loading...
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.