PDF (A4) - 43.4Mb
Man Pages (TGZ) - 297.2Kb
Man Pages (Zip) - 402.4Kb
Info (Gzip) - 4.3Mb
Info (Zip) - 4.3Mb
MySQL Globalization
MySQL Information Schema
MySQL Installation Guide
Security in MySQL
Starting and Stopping MySQL
MySQL and Linux/Unix
MySQL and Windows
MySQL and macOS
MySQL and Solaris
Building MySQL from Source
MySQL Restrictions and Limitations
MySQL Partitioning
MySQL Tutorial
MySQL Performance Schema
MySQL Replication
Using the MySQL Yum Repository
MySQL NDB Cluster 8.0
TheUSER_ATTRIBUTES table (available as of MySQL 8.0.21) provides information about user comments and user attributes. It takes its values from themysql.user system table.
TheUSER_ATTRIBUTES table has these columns:
USERThe user name portion of the account to which the
ATTRIBUTEcolumn value applies.HOSTThe host name portion of the account to which the
ATTRIBUTEcolumn value applies.ATTRIBUTEThe user comment, user attribute, or both belonging to the account specified by the
USERandHOSTcolumns. The value is in JSON object notation. Attributes are shown exactly as set usingCREATE USERandALTER USERstatements withATTRIBUTEorCOMMENToptions. A comment is shown as a key-value pair havingcommentas the key. For additional information and examples, seeCREATE USER Comment and Attribute Options.
Notes
USER_ATTRIBUTESis a nonstandardINFORMATION_SCHEMAtable.To obtain only the user comment for a given user as an unquoted string, you can employ a query such as this one:
mysql> SELECT ATTRIBUTE->>"$.comment" AS Comment -> FROM INFORMATION_SCHEMA.USER_ATTRIBUTES -> WHERE USER='bill' AND HOST='localhost';+-----------+| Comment |+-----------+| A comment |+-----------+Similarly, you can obtain the unquoted value for a given user attribute using its key.
Prior to MySQL 8.0.22,
USER_ATTRIBUTEScontents are accessible by anyone. As of MySQL 8.0.22,USER_ATTRIBUTEScontents are accessible as follows:All rows are accessible if:
The current thread is a replica thread.
The access control system has not been initialized (for example, the server was started with the
--skip-grant-tablesoption).The currently authenticated account has the
UPDATEorSELECTprivilege for themysql.usersystem table.The currently authenticated account has the
CREATE USERandSYSTEM_USERprivileges.
Otherwise, the currently authenticated account can see the row for that account. Additionally, if the account has the
CREATE USERprivilege but not theSYSTEM_USERprivilege, it can see rows for all other accounts that do not have theSYSTEM_USERprivilege.
For more information about specifying account comments and attributes, seeSection 15.7.1.3, “CREATE USER Statement”.
PDF (A4) - 43.4Mb
Man Pages (TGZ) - 297.2Kb
Man Pages (Zip) - 402.4Kb
Info (Gzip) - 4.3Mb
Info (Zip) - 4.3Mb
MySQL Globalization
MySQL Information Schema
MySQL Installation Guide
Security in MySQL
Starting and Stopping MySQL
MySQL and Linux/Unix
MySQL and Windows
MySQL and macOS
MySQL and Solaris
Building MySQL from Source
MySQL Restrictions and Limitations
MySQL Partitioning
MySQL Tutorial
MySQL Performance Schema
MySQL Replication
Using the MySQL Yum Repository
MySQL NDB Cluster 8.0