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:
- MySQL 5.7
- MySQL 5.6
- MySQL 5.5
- MySQL 5.1
- MySQL 5.0
- MySQL 4.1
- MySQL 4.0
- MySQL 3.23
Example: Implementing CONNECTION_ID() function.
SELECT CONNECTION_ID();
Output:
1196078
Recommended Posts:
- MySQL | MD5 Function
- MySQL | BIN() Function
- MySQL | IF( ) Function
- MySQL | SESSION_USER( ) Function
- MySQL | USER( ) Function
- MySQL | OLD_PASSWORD Function
- MySQL | CONVERT( ) Function
- MySQL | ISNULL( ) Function
- MySQL | NULLIF( ) Function
- MySQL | VERSION( ) Function
- MySQL | PASSWORD Function
- MySQL | Group_CONCAT() Function
- MySQL | BINARY Function
- MySQL | CONV( ) Function
- MySQL | LEAD() and LAG() Function
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.

