Information Functions seen by the empty user name part of the  CURRENT_USER()  value). One way this might occur is that there is no account listed in the grant tables for  davida . Within a stored program or view,  CURRENT_USER()  returns the account for the user who defined the object (as given by its  DEFINER  value) unless defined with the  SQL SECURITY INVOKER  characteristic. In the latter case,  CURRENT_USER()  returns the object’s invoker. Triggers and events have no option to define the  SQL SECURITY  characteristic, so for these objects, CURRENT_USER()  returns the account for the user who defined the object. To return the invoker, use USER()  or  SESSION_USER() . The following statements support use of the  CURRENT_USER()  function to take the place of the name of (and, possibly, a host for) an affected user or a definer; in such cases,  CURRENT_USER()  is expanded where and as needed: • DROP USER • RENAME USER • GRANT • REVOKE • CREATE FUNCTION • CREATE PROCEDURE • CREATE TRIGGER • CREATE EVENT • CREATE VIEW • ALTER EVENT • ALTER VIEW • SET PASSWORD For information about the implications that this expansion of  CURRENT_USER()  has for replication, see Section 17.5.1.8, “Replication of CURRENT_USER()” . 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 . 2283 • DATABASE()