Curriculum
Course: MYSQL
Login

Curriculum

MYSQL

MySQL References

0/140
Text lesson

USER

Example

Retrieve the current username and host details for the MySQL connection.

SELECT USER();

Definition and Usage

The USER() function retrieves the current username and host name for the MySQL connection.

Note: This function is equivalent to SESSION_USER() and SYSTEM_USER().

Tip: Additionally, consider the CURRENT_USER() function.

Syntax

USER()

Technical Details

Works in:

 From MySQL version 4.0