跳到主要内容

CONNECTION_ID

Return the connection id for the connection.

Syntax

SELECT CONNECTION_ID()

Examples

mysql> SELECT CONNECTION_ID();
+-------------------------------------------------------+
| CONNECTION_ID('9b16ca73-e393-43bb-a77b-fa546e1b7b69') |
+-------------------------------------------------------+
| 9b16ca73-e393-43bb-a77b-fa546e1b7b69 |
+-------------------------------------------------------+