mysql: how to generate a random 12 character string

simple:

        mysql> select substring( hex( rand() * pow(10,18) ), 1, 12 );
        +------------------------------------------------+
        | substring( hex( rand() * pow(10,18) ), 1, 12 ) |
        +------------------------------------------------+
        | 37501475AEDF                                   |
        +------------------------------------------------+
        1 row in set (0.00 sec)