Posted on

UUID in MySQL

You have 2 UUID related functions in MySQL:

UUID_SHORT() Return an integer-valued universal identifier
UUID() Return a Universal Unique Identifier (UUID)

Example usage:

INSERT INTO tbl1 (key, val) VALUES (UUID(), :value)

If you want to remove the ‘-‘:

REPLACE(UUID(),'-',''))
Leave a Reply

Your email address will not be published. Required fields are marked *