ID EN
Information Functions

USER()

MySQL 8.4 🇮🇩 Bahasa Indonesia

Mengembalikan nama pengguna dan nama host MySQL saat ini sebagai string dalam kumpulan karakter utf8mb3.

Syntax

MYSQL
SELECT USER();
'davida@localhost'

Contoh

Example

The value indicates the user name you specified when connecting to the server, and the client host from which you connected. The value can be different from that of CURRENT_USER().

MYSQL
SELECT USER();
'davida@localhost'
Example 2

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 (USER()));