Invalid syntax near RECURSIVE when creating a routine I'm trying to restore an mysqldump file but it complains about an syntax error related to my procedures.

ERROR 1064 (42000) at line 2860: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'RECURSIVE emptree (id, username, owner_id) AS (SELECT id, username, owner_id FRO' at line 3

Here is the routines syntax on the generated file:
--
-- Dumping routines for database 'XXXX'
--
/*!50003 DROP FUNCTION IF EXISTS `str_rand` */;
/*!50003 SET @saved_cs_client      = @@character_set_client */ ;
/*!50003 SET @saved_cs_results     = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client  = utf8mb4 */ ;
/*!50003 SET character_set_results = utf8mb4 */ ;
/*!50003 SET collation_connection  = utf8mb4_general_ci */ ;
/*!50003 SET @saved_sql_mode       = @@sql_mode */ ;
/*!50003 SET sql_mode              = 'NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
CREATE DEFINER=`root`@`%` FUNCTION `str_rand`(u_count INT UNSIGNED,
    v_chars TEXT
) RETURNS text CHARSET latin1
    NO SQL
    SQL SECURITY INVOKER
BEGIN
    DECLARE v_retval TEXT DEFAULT '';
    DECLARE u_pos    INT UNSIGNED;
    DECLARE u        INT UNSIGNED;

    SET u = LENGTH(v_chars);
    WHILE u_count &gt; 0
    DO
      SET u_pos = 1 + FLOOR(RAND() * u);
      SET v_retval = CONCAT(v_retval, MID(v_chars, u_pos, 1));
      SET u_count = u_count - 1;
    END WHILE;

    RETURN v_retval;
END ;;
DELIMITER ;
/*!50003 SET sql_mode              = @saved_sql_mode */ ;
/*!50003 SET character_set_client  = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection  = @saved_col_connection */ ;
/*!50003 DROP PROCEDURE IF EXISTS `getSubResellerIds` */;
/*!50003 SET @saved_cs_client      = @@character_set_client */ ;
/*!50003 SET @saved_cs_results     = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client  = utf8mb4 */ ;
/*!50003 SET character_set_results = utf8mb4 */ ;
/*!50003 SET collation_connection  = utf8mb4_general_ci */ ;
/*!50003 SET @saved_sql_mode       = @@sql_mode */ ;
/*!50003 SET sql_mode              = 'NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
CREATE DEFINER=`root`@`%` PROCEDURE `getSubResellerIds`(ABC INT(11) )
BEGIN
    WITH RECURSIVE emptree (id, username, owner_id) AS (SELECT id, username, owner_id FROM reg_users WHERE id = ABC UNION ALL SELECT c.id, c.username, c.owner_id FROM reg_users c JOIN emptree p ON p.id = c.owner_id)
    SELECT id FROM emptree;
END ;;
DELIMITER ;
/*!50003 SET sql_mode              = @saved_sql_mode */ ;
/*!50003 SET character_set_client  = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection  = @saved_col_connection */ ;

Any help?
It helps to pay attention to what error messages say (emphasis mine):

check the manual that corresponds to your MariaDB server version for the right syntax to use near 'RECURSIVE&quot;

meaning this particular version of the server has trouble understanding what &quot;RECURSIVE&quot; means. When we do check what the manual says about &quot;recursive&quot;, we indeed find that

Recursive Common Table Expressions have been supported since MariaDB 10.2.2.

Generally it's a bad idea to use different DBMS versions for development and production. As mentioned in the comments, &quot;grade your desktop up&quot;.