CONNECTION_ID

CONNECTION_ID is a function in MySQL that returns the unique connection ID for the current connection. It is vital for identifying specific connections in a multi-user environment, particularly for server administration and debugging purposes.

CONNECTION_ID()

Example

SELECT CONNECTION_ID();

Output

+-----------------+
| CONNECTION_ID() |
+-----------------+
| 3296 |
+-----------------+

Explanation

In the provided example, CONNECTION_ID() function is used, which returns the connection ID for the current connection. In this case, the returned connection ID is 3296.

For in-depth explanations and examples SQL keywords where you write your SQL, install our extension.