SQL Reference
...
SQL Functions
Other Functions
CURRENT_DATABASE
3min
The CURRENT_DATABASE() returns the current database's name.
The following syntax describes CURRENT_DATABASE() function.
It does not require any argument to operate.
In the following example, we will obtain the database name to which we are currently connected.
The function will return the result with the database name: