DATABASE() Returns the default (current) database name as a string in the utf8 character set. If there is no default database, DATABASE() returns NULL. Within a stored routine, the default database is the database that the routine is associated with, which is not necessarily the same as the database that is the default in the calling context. mysql> SELECT DATABASE(); -> 'test'If there is no default database, DATABASE() returns NULL.
-> 'test'DATABASE()
返回使用 utf8 字符集的默认(当前)数据库名。在存储程序里,默认数据库是同该程序向关联的数据库,但并不一定与调用语境的默认数据库相同。 mysql> SELECT DATABASE(); -> 'test'若没有默认数据库, DATABASE()返回 NULL。
-> 'test'If there is no default database, DATABASE() returns NULL.