Information Functions MySQL Tutorial

Every connection has an ID that is unique among the set of currently connected clients.

mysql>
mysql> SELECT CONNECTION_ID();
+-----------------+
| CONNECTION_ID() |
+-----------------+
|              37 |
+-----------------+
1 row in set (0.00 sec)
mysql>