Curriculum
Course: SQL
Login

Curriculum

SQL

SQL References

0/80

MySQL Functions

0/139

SQL Server Functions

0/84

SQL Quick Ref

0/1
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