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
You need to temporarily change the delimiter so the MySQL client doesn't think you're done with your statement when it sees the semicolon on line 3:
DELIMITER // CREATE PROCEDURE dorepeat(IN p1 INT) BEGIN DECLARE x INT DEFAULT 0; REPEAT SET x = x + 1; UNTIL x > p1 END REPEAT; END// DELIMITER ;