22.10.8 Performance Schema Connection Attribute Tables

22.10.8.1 The session_account_connect_attrs Table
22.10.8.2 The session_connect_attrs Table

As of MySQL 5.6.6, application programs can provide key/value pairs as connection attributes to be passed to the server at at connect time. For the C API, define the attribute set using the mysql_options() and mysql_options4() functions. Other MySQL Connectors may provide their own attribute-definition methods.

These tables expose attribute information:

Attribute names that begin with an underscore (_) are reserved for internal use and should not be created by application programs. This convention permits new attributes to be introduced by MySQL without colliding with application attributes.

The set of connection attributes visible on a given connection varies depending on your platform and MySQL Connector used to establish the connection.

The libmysqlclient client library (provided in MySQL and MySQL Connector/C distributions) sets these attributes:

Other MySQL Connectors may define their own connection attributes.

MySQL Connector/J defines these attributes:

MySQL Connector/Net defines these attributes:

PHP defines attributes that depend on how it was compiled:

Many MySQL client programs set a program_name attribute with a value equal to the client name. For example, mysqladmin and mysqldump set program_name to mysqladmin and mysqldump, respectively.

Some MySQL clients define additional attributes:

There are limits on the amount of connection attribute data transmitted from client to server: A fixed limit imposed by the client prior to connect time; a fixed limit imposed by the server at connect time; and a configurable limit imposed by the Performance Schema at connect time.

For connections initiated using the C API, the libmysqlclient library imposes a limit of 64KB on the aggregate size of connection attribute data on the client side: Calls to mysql_options() that cause this limit to be exceeded produce a CR_INVALID_PARAMETER_NO error. Other MySQL Connectors may impose their own client-side limits on how much connection attribute data can be transmitted to the server.

On the server side, these size checks on connection attribute data occur: