Syntax error, Hello World example. Begin ... End I borrow an example hello world function for mysql, but it throws me an error, I don't know where is the syntax error in my query.

DROP FUNCTION IF EXISTS helloWorld;

CREATE FUNCTION helloWorld( s char(20)) 
RETURNS VARCHAR(50) 
BEGIN
    RETURN CONCAT("Hello ", s);
END;

SELECT helloWorld("Albert");


MYSQL Version: 5.7.21


  ERROR: [ERROR en la consulta 2] You have an error in your SQL syntax;
  check the manual that corresponds to your MySQL server version for the
  right syntax to use near '' at line 4


If I do the query without BEGIN ... END It works, but I can't do the query without more than 1 line of body.
It seems like mysql is confused about the delimeter.

The delimeter for RETURN CONCAT("Hello ", s); is ";".

The delimeter for the query is ";"

I had to change the delimeter to "//" get a good query and change it again to ";".

DROP FUNCTION IF EXISTS helloWorld;

DELIMITER //

CREATE FUNCTION helloWorld(s char(20))
   RETURNS CHAR(50)
   BEGIN

     RETURN CONCAT("Hello ", s);
   END; //

DELIMITER ;

SELECT helloWorld("Albert");


I don't know why, but this is happening only in my DB.