MariaDB Tutorial MariaDB Advanced MariaDB Database Account Management MariaDB References

MariaDB SYSTEM_USER() Function



The MariaDB SYSTEM_USER() function returns the user name and host name for the current MariaDB user. The user name is the name of the user specified when connecting to the server and the host name is the name of the client host that the user connected from.

The SYSTEM_USER() and SESSION_USER() functions are synonyms for the USER() function. Note that, the CURRENT_USER() function can return a different value than the SYSTEM_USER() function.

Syntax

SYSTEM_USER()

Parameters

No parameter is required.

Return Value

Returns the user name and host name for the current MariaDB user.

Example:

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

SELECT SYSTEM_USER();

The above query will return the user name and host name for the current MariaDB user. Therefore if the user name specified when connecting to the server was 'root' and the name of the client host that the user connected from was 'alphacodingskills.com' it will return the following:

SELECT SYSTEM_USER();
Result: 'root@alphacodingskills.com'

❮ MariaDB Functions