totn MariaDB Functions

MariaDB: CONNECTION_ID Function

This MariaDB tutorial explains how to use the MariaDB CONNECTION_ID function with syntax and examples.

Description

The MariaDB CONNECTION_ID function returns the connection ID for the current connection, which is a unique ID among the currently connected clients.

Syntax

The syntax for the CONNECTION_ID function in MariaDB is:

CONNECTION_ID( )

Parameters or Arguments

There are no parameters or arguments for the CONNECTION_ID function in MariaDB.

Note

  • Each connection in the MariaDB database has a connection ID that is unique among the currently connected clients.

Applies To

The CONNECTION_ID function can be used in the following versions of MariaDB:

  • MariaDB 10

Example

Let's look at some MariaDB CONNECTION_ID function examples and explore how to use the CONNECTION_ID function in MariaDB.

For example:

SELECT CONNECTION_ID();

Since the CONNECTION_ID function returns the unique ID for the current connection, t might display something like this:

SELECT CONNECTION_ID();
Result: 49

In this case, the unique ID for the connection is 49.