CREATE PROCEDURE dorepeat(IN p1 INT) BEGIN DECLARE x INT DEFAULT 0; REPEAT SET x = x + 1; UNTIL x > p1 END REPEAT; END
I get an syntax error
Remove the DECLARE, you should be able to just do this:
SET @x = 0;
Also, variables need to be prefixed with the @ symbol