MySQL DATABASE() Function

Example

Return the name of the current (default) database:

SELECT DATABASE();
Try it Yourself »

Definition and Usage

The DATABASE() function returns the name of the current database.

If there is no current database, this function returns NULL or "".

Syntax

DATABASE()

Technical Details

Works in: From MySQL 4.0

Copyright 1999-2023 by Refsnes Data. All Rights Reserved.