MySQL begin end from documentation doesn't work
While creating procedure, function or another compound statement consisted from more than 1 command, You MUST use DELIMITER statement. 

The reason is simple - command to create procedure is one command. But it consists from a lot of common commands. When You enter its code, server has no any marker, what kind of command is terminated by any delimiter - simple statement or compound statement. To avoid it You must use separate delimiters for that aims. Because standard delimiter will be used when server executes procedure, You must NOT alter default delimiter used for common commands. So You must alter delimiter used for fixed compound statement.

You must update Your code:

DELIMITER @@; -- Alter delimiter to 3-symbol one 
              -- not contained in compound statement we want to create

CREATE PROCEDURE dowhile()
BEGIN
  DECLARE v1 INT DEFAULT 5; -- Std delimiter, terminates single statement
  WHILE v1 &gt; 0 DO
    SET v1 = v1 - 1;
  END WHILE;
END;
@@;  -- Altered delimiter terminated compound statement

DELIMITER ; -- restore delimiter to standard semicolon