Try this option -
SELECT CONCAT( CHAR( FLOOR(65 + (RAND() * 25))), CHAR( FLOOR(65 + (RAND() * 25))), CHAR( FLOOR(65 + (RAND() * 25))), CHAR( FLOOR(65 + (RAND() * 25))), CHAR( FLOOR(65 + (RAND() * 25))) ) random_string;
This query generates ASCII codes from "A" to "Z" and generates a random string from them. I canโt say that this method is elegant, but it works; -)
source share