UUID ( )

This MySQL function returns a Universal Unique Identifier (UUID), a 128-bit number composed of five hexadecimal numbers.

Syntax

Below is the syntax for this command. Text within square brackets (i.e, [ and ] ) are optional. Choices are separated by bars (i.e, | ). Ellipses preceded by a comma indicates a repeating pattern. Ellipses before or after syntax are used to highlight a relevant except from the larger syntax. Text displayed in italic letters represent text that should be replaced with the specific names related to the database (e.g., column with the name of the column).

UUID( )

Explanation

This function returns a Universal Unique Identifier (UUID), a 128-bit number composed of five hexadecimal numbers. This number is intended to be unique per invocation and is based on values that are both temporal and spatial. There are no arguments for the function. It's available as of Version 4.1.2 of MySQL.

Examples

SELECT UUID( );

+----------------------------------------+
| UUID( )                                |
+----------------------------------------+
| '8bde367a-caeb-0933-1031-7730g3321c32' |
+----------------------------------------+

The first three hexadecimal set of numbers are based on the date and time of the execution of the statement. The fourth set is based on time regardless of daylight saving time. The last set is a unique number, an IEEE 802 node number related to the computer generating the number. For instance, for some operating sytems it could be the network card's MAC address.