Syntax\n------\n\nUUID_v4()\n\nDescription\n-----------\n\nReturns a Universally Unique Identifier (UUID) version 4. To generate a version 1 UUID, see the UUID function. To generate a version 7 UUID, see UUIDv7.\n\nA 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 computers that are not connected to each other.\n\nUUID_v4() results are intended to be unique, but cannot always be relied upon to be unpredictable and unguessable.\n\nA UUID is a 128-bit number represented by a utf8 string of five hexadecimal numbers in aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee format.\n\nStatements using the UUID_v4() function are not safe for statement-based replication.\n\nExamples\n--------\n\nSELECT UUID(),UUID_v4(),UUID_v7()\\G \n************************ 1. row ************************\n  UUID(): 63ae8c92-799a-11ef-98b2-f859713e4be4\nUUID_v4(): a2443495-1b94-415b-b6fa-fe8e79ba4812\nUUID_v7(): 01921e85-f198-7490-9b89-7dd0d468543b\n\nCREATE TABLE t1 (a INT PRIMARY KEY NOT NULL, u UUID DEFAULT UUID_v4(), UNIQUE KEY(u));\n\nURL: https://mariadb.com/docs/server/reference/sql-functions/secondary-functions/miscellaneous-functions/uuid_v4