You will learn how to use the CURRENT_DATABASE() function to get the database’s name.
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:
Updated 11 May 2023
Did this page help you?