ID EN
Miscellaneous Functions

UUID()

MySQL 8.4

Returns a Universal Unique Identifier (UUID) generated according to RFC 4122, “A Universally Unique IDentifier (UUID) URN Namespace” (http://www.ietf.org/rfc/rfc4122.txt).

Syntax

MYSQL
SELECT UUID();
'6ccd780c-baba-1026-9564-5b8c656024db'

Examples

Example

A UUID is designed as a number that is globally unique in space and time. Two calls to UUID() are expected to generate two different values, even if these calls are performed on two separate devices not connected to each other.

MYSQL
SELECT UUID();
'6ccd780c-baba-1026-9564-5b8c656024db'