DATABASE() returns the default (current) database name. : DATABASE « Information Functions « MySQL Tutorial






mysql>
mysql>
mysql> SELECT DATABASE();
+------------+
| DATABASE() |
+------------+
| test       |
+------------+
1 row in set (0.00 sec)

mysql>








20.8.DATABASE
20.8.1.DATABASE() returns the default (current) database name.