ID EN
Information Functions

SESSION_USER()

MySQL 8.4

SESSION_USER() is a synonym for USER().

Syntax

MYSQL
CREATE TABLE t (c VARCHAR(288) DEFAULT (SESSION_USER()));

Examples

Example

Like USER(), this function can be used for the default value of a VARCHAR or TEXT column, as shown in the following CREATE TABLE statement:

MYSQL
CREATE TABLE t (c VARCHAR(288) DEFAULT (SESSION_USER()));