Last active
June 4, 2020 01:01
-
-
Save mrLexx/4f6c002d821242ec70d0cbc27e98ffaf to your computer and use it in GitHub Desktop.
Generate a random string in MySQL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT SUBSTRING(REPLACE(REPLACE(REPLACE( TO_BASE64(MD5(RAND())), '=',''),'+',''),'/',''), 2, 8); | |
SELECT SUBSTRING(REPLACE(REPLACE(REPLACE( TO_BASE64(MD5(RAND())), '=',''),'+',''),'/',''), 2, FLOOR(10+RAND()*31)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment