Skip to content
Related Articles
Get the best out of our app
GFG App
Open App
geeksforgeeks
Browser
Continue

Related Articles

MySQL | SESSION_USER( ) Function

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

The MySQL SESSION_USER() function is used for returning the current user name and host name for the MySQL connection being used by the user. The SESSION_USER() function does not require any parameter to be passed.

The user name returned by the SESSION_USER() function is the name of the user-specified when connecting to the server whereas the host name returned by the SESSION_USER() function is the name of the client host that the user uses to establish a connection from.

Syntax:

SESSION_USER()

Parameters Used:
It does not require any parameter or argument to be passed.

Return Value:
The MySQL SESSION_USER() function returns the current user name and host name for the MySQL connection.

Supported Versions of MySQL

  • MySQL 5.7
  • MySQL 5.6
  • MySQL 5.5
  • MySQL 5.1
  • MySQL 5.0
  • MySQL 4.1
  • MySQL 4.0
  • MySQL 3.23

Example: Implementing SESSION_USER() function in MySQL.

SELECT SESSION_USER(); 

Output:

author@gfg 
My Personal Notes arrow_drop_up
Last Updated : 25 Nov, 2019
Like Article
Save Article
Similar Reads