SESSION_CONNECT_ATTRS

The SESSION_CONNECT_ATTRS table provides information about connection attributes. Session attributes are key-value pairs that are sent by the client when establishing a connection.

Common attributes:

Attribute NameExampleDescription
_client_namelibmysqlClient library name
_client_version8.0.33Client library version
_osLinuxOperating System
_pid712927Process ID
_platformx86_64CPU Architecture
program_namemysqlshProgram name

You can view the columns of the SESSION_CONNECT_ATTRS table as follows:

  1. USE performance_schema;
  2. DESCRIBE session_connect_attrs;
  1. +------------------+---------------------+------+-----+---------+-------+
  2. | Field | Type | Null | Key | Default | Extra |
  3. +------------------+---------------------+------+-----+---------+-------+
  4. | PROCESSLIST_ID | bigint(20) unsigned | NO | | NULL | |
  5. | ATTR_NAME | varchar(32) | NO | | NULL | |
  6. | ATTR_VALUE | varchar(1024) | YES | | NULL | |
  7. | ORDINAL_POSITION | int(11) | YES | | NULL | |
  8. +------------------+---------------------+------+-----+---------+-------+

You can view the information on session attributes stored in the SESSION_CONNECT_ATTRS table as follows:

  1. USE performance_schema;
  2. TABLE SESSION_CONNECT_ATTRS;
  1. +----------------+-----------------+------------+------------------+
  2. | PROCESSLIST_ID | ATTR_NAME | ATTR_VALUE | ORDINAL_POSITION |
  3. +----------------+-----------------+------------+------------------+
  4. | 2097154 | _client_name | libmysql | 0 |
  5. | 2097154 | _client_version | 8.1.0 | 1 |
  6. | 2097154 | _os | Linux | 2 |
  7. | 2097154 | _pid | 1299203 | 3 |
  8. | 2097154 | _platform | x86_64 | 4 |
  9. | 2097154 | program_name | mysqlsh | 5 |
  10. +----------------+-----------------+------------+------------------+

Fields in the SESSION_CONNECT_ATTRS table are described as follows:

  • PROCESSLIST_ID: Processlist ID of the session.
  • ATTR_NAME: Attribute name.
  • ATTR_VALUE: Attribute value.
  • ORDINAL_POSITION: Ordinal position of the name/value pair.