Open In App

MySQL | CONNECTION_ID( ) Function

The MySQL CONNECTION_ID() function is used for return the connection ID for a current connection in MySQL. The connection ID used to establish a connection to a database is unique for every connection among the connected clients. The CONNECTION_ID() function does not require any parameters or arguments.

The value returned by the CONNECTION_ID() function is the same type of value as displayed in the ID column of the INFORMATION_SCHEMA.PROCESSLIST table.



Syntax:

CONNECTION_ID()

Parameters Used:
The CONNECTION_ID() function does not require any parameters or arguments.



Return Value:
The MySQL CONNECTION_ID() function returns an integer value which represents the unique current connection ID.

Supported Versions of MySQL:

Example: Implementing CONNECTION_ID() function.

SELECT CONNECTION_ID(); 

Output:

1196078 
Article Tags :
SQL