CURRENT_DATABASE
4min
You will learn how to use the CURRENT_DATABASE() function to get the database’s name.
Overview
The CURRENT_DATABASE() returns the current database's name.
Syntax
The following syntax describes CURRENT_DATABASE() function.
Syntax
|
It does not require any argument to operate.
Example
In the following example, we will obtain the database name to which we are currently connected.
Current database
|
The function will return the result with the database name:
Output
|

Updated 11 May 2023
Did this page help you?
Yes
No