Skip to main content
Version: V1.0.0

DATABASE

Syntax

DATABASE()

Description

Returns the name of the current database in the utf8mb4 character set.

If no database is specified by using the USE statement, this function returns NULL.

Examples

Returns the name of the current database.

SELECT DATABASE();
+------------+
| DATABASE() |
+------------+
| oceanbase |
+------------+
1 row in set (0.001 sec)