MariaDB Tutorial MariaDB Advanced MariaDB Database Account Management MariaDB References

MariaDB CONNECTION_ID() Function



The MariaDB CONNECTION_ID() function returns the unique connection ID for the current connection. Each connection in MariaDB database has a connection ID that is unique among the currently connected clients.

Syntax

CONNECTION_ID()

Parameters

No parameter is required.

Return Value

Returns the unique connection ID for the current connection.

Example:

The example below shows the usage of CONNECTION_ID() function.

SELECT CONNECTION_ID();

The above query will return the unique connection ID for the current connection and the output of the above query will be similar to:

SELECT CONNECTION_ID();
Result: 943851

In this case, the unique connection ID is 943851.


❮ MariaDB Functions