Since MySQL does not allow the users to create a recursive function, let me show you using stored procedure:
Assuming the table you are working on is named "test".
DELIMITER $$
DROP PROCEDURE IF EXISTS build_chain$$
CREATE PROCEDURE build_chain(init CHAR(1))
BEGIN
IF init != '-' THEN
SET @r := (SELECT DISTINCT(root) FROM test WHERE root = init);
SET @search_type := TRUE;
SET @result := @r;
END IF;
SET @r := (SELECT DISTINCT(connector) FROM test WHERE root = @r AND connector != '-');
SET @result = CONCAT_WS('->', @result, @r);
SET @search_type = IF(@search_type, FALSE, TRUE);
IF @r IS NOT NULL THEN CALL build_chain('-'); ELSE SELECT @result AS result_chain; END IF;
END$$
DELIMITER ;
Usage:
SET max_sp_recursion_depth = 255;
CALL build_chain('a');
Result (the chain) is stored in @result variable.
Note: you can also build the chain using programming language other than MySQL.